From 9b330bc95f5f2ae45794f07f7f8ebcd76e7048bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20S=C3=A9r=C3=A9g=C3=A9?= Date: Tue, 30 Mar 2021 10:53:43 +0200 Subject: [PATCH] Fix text actualBoundingBoxLeft and actualBoundingBoxRight measures by using ink_rect instead of logical_rect --- src/CanvasRenderingContext2d.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index dba80662b..01d07b734 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -2698,10 +2698,10 @@ NAN_METHOD(Context2d::MeasureText) { Nan::New(logical_rect.width)).Check(); Nan::Set(obj, Nan::New("actualBoundingBoxLeft").ToLocalChecked(), - Nan::New(x_offset - PANGO_LBEARING(logical_rect))).Check(); + Nan::New(x_offset - PANGO_LBEARING(ink_rect))).Check(); Nan::Set(obj, Nan::New("actualBoundingBoxRight").ToLocalChecked(), - Nan::New(x_offset + PANGO_RBEARING(logical_rect))).Check(); + Nan::New(x_offset + PANGO_RBEARING(ink_rect))).Check(); Nan::Set(obj, Nan::New("actualBoundingBoxAscent").ToLocalChecked(), Nan::New(y_offset + PANGO_ASCENT(ink_rect))).Check();