From ae6a570684f9c872d4de8ee9b21415882bad8131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Dias?= Date: Thu, 25 Feb 2021 12:43:33 -0300 Subject: [PATCH] Add missing baseline correction Extracted from the booklet; I missed it before. --- src/Bloc-Memory/MGCardElement.class.st | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bloc-Memory/MGCardElement.class.st b/src/Bloc-Memory/MGCardElement.class.st index f9841ea..b29d8b1 100644 --- a/src/Bloc-Memory/MGCardElement.class.st +++ b/src/Bloc-Memory/MGCardElement.class.st @@ -111,12 +111,15 @@ MGCardElement >> drawFlippedSideOn: aCanvas [ named: 'Source Sans Pro'; size: 50; build. + textPainter := aCanvas text font: font; paint: Color white; string: self card symbol asString. + metrics := textPainter measure. - origin := self extent - metrics textMetrics bounds extent / 2.0. + origin := (self extent - metrics textMetrics bounds extent) / 2.0. + origin := origin - metrics textMetrics bounds origin. textPainter baseline: origin; draw