Fix misalignment of monitor tools CCBUG: 498337 CCBUG:461219
- Fixes rounding error when converting between cpp and qml offsets. In cpp we use top-left integer offset but in QML centered x/y floating point coords. This accumulated in a misalignment by a few pixels. Also affected drawing the overlays / grids being off slightly.
- Fixes zoombar compensation when setting qml offsets. This was hardcoded to 10 pixels but on my system this is 14. This resulted in major misalignment on higher zoom levels as the error is multiplied by the zoom factor.
2nd problem is most noticable when using rotoscope on a high zoom level but affected all tools. Notice yellow rectangle is off as well as red rotoscope mask border
1st problem was also noticable when not zoomed. See slight offset of red rectangle at the bottom
misaligned:
fixed:
I was pulling my hair out trying to understand what 10 * m_zoom
is supposed to be until I understood that is supposed to be the size of the opposite zoombar...
This is definitely a fix for https://bugs.kde.org/show_bug.cgi?id=498337
and I think also for https://bugs.kde.org/show_bug.cgi?id=461219
but I'm not exactly sure about the 2nd report or if reported meant something different.
Edited by balooii balooii