* viewer/image_region.cc,
* viewer/image_region.hxx:
Fix graphic bug when moving the view while an object is selected.
---
viewer/image_region.cc | 4 +++-
viewer/image_region.hxx | 2 ++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/viewer/image_region.cc b/viewer/image_region.cc
index 7761065..455b0d0 100644
--- a/viewer/image_region.cc
+++ b/viewer/image_region.cc
@@ -104,6 +104,7 @@ ImageRegion::select()
{
selected_ = true;
setZValue(2);
+ prepareGeometryChange();
scene()->invalidate();
update();
}
@@ -115,8 +116,9 @@ ImageRegion::deselect()
if (selected_)
{
selected_ = false;
- scene()->invalidate();
setZValue(1);
+ prepareGeometryChange();
+ scene()->invalidate();
update();
}
}
diff --git a/viewer/image_region.hxx b/viewer/image_region.hxx
index b15615c..d695234 100644
--- a/viewer/image_region.hxx
+++ b/viewer/image_region.hxx
@@ -70,6 +70,8 @@ inline
QRectF
ImageRegion::boundingRect() const
{
+ if (selected_)
+ return mapFromScene(scene()->sceneRect()).boundingRect();
return rect_;
}
--
1.5.6.5
Show replies by date