diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-03-26 11:36:37 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-03-27 16:07:59 +0100 |
commit | 5b51aa12e8ebfa894ecfdd0c8c9004aa99e6f46d (patch) | |
tree | 22579d695d43818ef802168ef97279c40114b6d9 /svx | |
parent | 5f8aaa09d3d7fbf10446b085f9ace83c074a65c3 (diff) |
tdf#123505 svx: fix invalidation loop caused by special form control geometry
Regression from commit d464d505fbf6e53a38afdd3661d320fac8c760d6
(Refactor calc non-linear ViewToDevice transform, 2018-10-12), the
problem was that the opengl menu was never painted from the starved idle
handler as a paint-invalidation loop starved the main loop.
ScGridWindow::Paint() called vcl::Window::ImplPosSizeWindow() for the
form control of the bugdoc, which triggered an invalidation -> paint ->
start again.
Checking what adjustControlGeometry_throw() did, the result of the
transformed points are quite close to each other, but not equivalent:
debug:18521:18521: adjustControlGeometry_throw: aTopLeft before transformation is (1773,426)
debug:18521:18521: adjustControlGeometry_throw: aTopLeft after transformation is (64.935,16.0382)
debug:18521:18521: adjustControlGeometry_throw: aPaintRectPixel is 952x586@(64,16)
If we round, rather than truncate, then the size of the control is
always the same, so no actual resize and invalidation happens during
paint.
Change-Id: Id55fd227e3ae7fc57d5253bc28f42b9b4315450e
Reviewed-on: https://gerrit.libreoffice.org/69821
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 50dcbd25e71e..02e93dc159be 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -298,7 +298,10 @@ namespace sdr { namespace contact { ::basegfx::B2DPoint aBottomRight( _rLogicBoundingRect.Right(), _rLogicBoundingRect.Bottom() ); aBottomRight *= _rViewTransformation; - const tools::Rectangle aPaintRectPixel( static_cast<long>(aTopLeft.getX()), static_cast<long>(aTopLeft.getY()), static_cast<long>(aBottomRight.getX()), static_cast<long>(aBottomRight.getY()) ); + const tools::Rectangle aPaintRectPixel(static_cast<long>(std::round(aTopLeft.getX())), + static_cast<long>(std::round(aTopLeft.getY())), + static_cast<long>(std::round(aBottomRight.getX())), + static_cast<long>(std::round(aBottomRight.getY()))); _rControl.setPosSize( aPaintRectPixel ); // determine the scale from the current view transformation, and the normalization matrix |