diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-07-17 12:38:41 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-07-23 06:01:56 +0200 |
commit | 4b743de97fc133623e46827869c4ea3eb845ad47 (patch) | |
tree | 6386636517576c81502367819996972877adc544 /svx/qa | |
parent | ea0f9776ed8e7e9809853d292923b86756274564 (diff) |
tdf#156234: Don’t round glyph coordinates when doing subpixel positioning
When doing subpixel positioning (i.e. OutputDevice is in map mode),
delay the rounding of the glyph coordinates after converting from pixel
to logical units to minimize the loss of precision as much as possible.
Some test expectations, expectedly, changes due to the improved
positioning precision.
Change-Id: I2591e3c7d4923ba7886a35bf53db759273354e24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154292
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'svx/qa')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index f285baa27e63..be3808dfd3fc 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -441,10 +441,10 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145111_anchor_in_Fontwork) SdrObjCustomShape& rSdrCustomShape( static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); - // Without the fix in place top was 2295, but should be 2916 for 96dpi. + // Without the fix in place top was 2295, but should be 2908 for 96dpi. // Was 2184, should be 2886 for 120dpi. tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect()); - CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(2916), aBoundRect.Top(), 5); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(2908), aBoundRect.Top(), 5); } { // Second shape has anchor set to Bottom-Left, which shifts Fontwork text up. @@ -452,10 +452,10 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145111_anchor_in_Fontwork) SdrObjCustomShape& rSdrCustomShape( static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); - // Without the fix in place top was 10294, but should be 9519 for 96dpi. + // Without the fix in place top was 10294, but should be 9508 for 96dpi. // Was 10184, should be 9481 for 120dpi. tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect()); - CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(9519), aBoundRect.Top(), 5); + CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(9508), aBoundRect.Top(), 5); } } |