Bugfix: redrawing issues when multiple layers are affected

This is how to reproduce the bug: have a layout with two
layers. Select two shapes of different layers and delete them.
One layer is not updated and only after zooming/panning the
shape will disappear on this layer.
This commit is contained in:
Matthias Koefferlein
2017-09-07 01:04:40 +02:00
parent e52c96b0bc
commit c541cdcbd6
5 changed files with 313 additions and 25 deletions
+4 -2
View File
@@ -40,6 +40,7 @@
#include "layBitmapsToImage.h"
#include <sstream>
#include <algorithm>
namespace lay
{
@@ -1149,7 +1150,9 @@ LayoutCanvas::redraw_selected (const std::vector<int> &layers)
}
m_need_redraw = true;
m_need_redraw_layer = layers;
m_need_redraw_layer.insert (m_need_redraw_layer.end (), layers.begin (), layers.end ());
std::sort (m_need_redraw_layer.begin (), m_need_redraw_layer.end ());
m_need_redraw_layer.erase (std::unique (m_need_redraw_layer.begin (), m_need_redraw_layer.end ()), m_need_redraw_layer.end ());
m_redraw_force_update = true;
update (); // produces a paintEvent()
@@ -1166,7 +1169,6 @@ LayoutCanvas::change_visibility (const std::vector <bool> &visible)
if (! m_need_redraw) {
m_redraw_clearing = false;
m_need_redraw_layer.clear ();
}
m_need_redraw = true;
+1 -1
View File
@@ -2126,7 +2126,7 @@ LayoutView::signal_bboxes_from_layer_changed (unsigned int cv_index, unsigned in
// redraw only the layers required for redrawing
for (std::vector<lay::RedrawLayerInfo>::const_iterator l = mp_canvas->get_redraw_layers ().begin (); l != mp_canvas->get_redraw_layers ().end (); ++l) {
if (l->cellview_index == int (cv_index) && (layer_index == std::numeric_limits<unsigned int>::max () || l->layer_index == int (layer_index))) {
if (l->cellview_index == int (cv_index) && l->layer_index == int (layer_index)) {
redraw_layer ((unsigned int) (l - mp_canvas->get_redraw_layers ().begin ()));
}
}