summaryrefslogtreecommitdiff
path: root/navit/graphics
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2021-09-13 11:36:50 +0200
committerGitHub <noreply@github.com>2021-09-13 11:36:50 +0200
commit0ed1660858a6b3055077f3b0d245c0316beb621c (patch)
tree64faca31f26907f3e46cab8622e792839386cec0 /navit/graphics
parentda065b411d6bee9e7f9b7424bb615d64c7e4cc54 (diff)
downloadnavit-0ed1660858a6b3055077f3b0d245c0316beb621c.tar.gz
Fix:core: cancel drawing on resize request (#1142)
* Fix:core: cancel drawing on resize request This commit causes navit to cancel async drawing in case of resize request. Drawing is started again after that. this should effectively cause a redraw on subsequent calls to resize. Some graphics like qt5 call resize for both dimension changes if the wigdet get's resized. * Fix:graphics:qt5 Clear pixmap on resize To remove ugly artefacts after resizing the widget until navit completes to redraw the screen the widgets pixmap is cleared.
Diffstat (limited to 'navit/graphics')
-rw-r--r--navit/graphics/qt5/QNavitQuick.cpp7
-rw-r--r--navit/graphics/qt5/QNavitWidget.cpp7
2 files changed, 2 insertions, 12 deletions
diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp
index dcd0d2aa5..966072852 100644
--- a/navit/graphics/qt5/QNavitQuick.cpp
+++ b/navit/graphics/qt5/QNavitQuick.cpp
@@ -181,12 +181,7 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe
if (graphics_priv->pixmap == NULL) {
graphics_priv->pixmap = new QPixmap(width(), height());
}
- painter = new QPainter(graphics_priv->pixmap);
- if (painter != NULL) {
- QBrush brush;
- painter->fillRect(0, 0, width(), height(), brush);
- delete painter;
- }
+ graphics_priv->pixmap->fill(Qt::transparent);
dbg(lvl_debug, "size %fx%f", width(), height());
dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(),
graphics_priv->pixmap->height());
diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp
index 869d5f2ec..43c04d87f 100644
--- a/navit/graphics/qt5/QNavitWidget.cpp
+++ b/navit/graphics/qt5/QNavitWidget.cpp
@@ -105,12 +105,7 @@ void QNavitWidget::resizeEvent(QResizeEvent* event) {
if (graphics_priv->pixmap == NULL) {
graphics_priv->pixmap = new QPixmap(size());
}
- painter = new QPainter(graphics_priv->pixmap);
- if (painter != NULL) {
- QBrush brush;
- painter->fillRect(0, 0, width(), height(), brush);
- delete painter;
- }
+ graphics_priv->pixmap->fill(Qt::transparent);
dbg(lvl_debug, "size %dx%d", width(), height());
dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(),
graphics_priv->pixmap->height());