[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

Jan Holesovsky kendy at collabora.com
Wed Dec 13 21:41:47 UTC 2017


 loleaflet/src/control/Control.ColumnHeader.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit ad712291d938d9439ee1c239db7ca71064fa74a2
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Dec 13 21:33:05 2017 +0100

    Adjust the vertical centering of the column headers slightly.
    
    Change-Id: Ief485cfb24bd57d5ec410866189e383658293cc4
    Reviewed-on: https://gerrit.libreoffice.org/46425
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js
index 7b0a25ab..6b0ae0d7 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -245,7 +245,11 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 		ctx.font = this._font;
 		ctx.textAlign = 'center';
 		ctx.textBaseline = 'middle';
-		ctx.fillText(content, endPar - (width / 2), startOrt + (height / 2));
+		// The '+ 1' below is a hack - it's currently not possible to measure
+		// the exact bounding box in html5's canvas, and the textBaseline
+		// 'middle' measures everything including the descent etc.
+		// '+ 1' looks visually fine, and seems safe enough
+		ctx.fillText(content, endPar - (width / 2), startOrt + (height / 2) + 1);
 		// draw row separator
 		ctx.fillStyle = this._borderColor;
 		ctx.fillRect(endPar -1, startOrt, this._borderWidth, height);


More information about the Libreoffice-commits mailing list