From 0a7638e10d197475d46c27997716befa35a0b0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=20H=C3=B6pfner?= Date: Fri, 10 Nov 2017 09:38:08 +0100 Subject: [PATCH] iOS: fix text drawing with stroke width (#441) --- vtm-ios/src/org/oscim/ios/backend/IosCanvas.java | 2 -- vtm-ios/src/org/oscim/ios/backend/IosPaint.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/vtm-ios/src/org/oscim/ios/backend/IosCanvas.java b/vtm-ios/src/org/oscim/ios/backend/IosCanvas.java index 45da0d63..e623bcf2 100644 --- a/vtm-ios/src/org/oscim/ios/backend/IosCanvas.java +++ b/vtm-ios/src/org/oscim/ios/backend/IosCanvas.java @@ -76,8 +76,6 @@ public class IosCanvas implements Canvas { IosPaint iosFill = (IosPaint) fill; if (stroke != null) { IosPaint iosStroke = (IosPaint) stroke; - iosFill.setStrokeWidth(iosStroke.strokeWidth); - iosFill.setStrokeColor(iosStroke.getColor()); iosStroke.drawLine(this.cgBitmapContext, string, x, y); } iosFill.drawLine(this.cgBitmapContext, string, x, y); diff --git a/vtm-ios/src/org/oscim/ios/backend/IosPaint.java b/vtm-ios/src/org/oscim/ios/backend/IosPaint.java index 2865f6e6..8dc444ac 100644 --- a/vtm-ios/src/org/oscim/ios/backend/IosPaint.java +++ b/vtm-ios/src/org/oscim/ios/backend/IosPaint.java @@ -194,7 +194,7 @@ public class IosPaint implements Paint { !!!!! NOTE: The value of NSStrokeWidthAttributeName is interpreted as a percentage of the font point size. */ - float strokeWidthPercent = -(this.strokeWidth / this.textSize * 50); + float strokeWidthPercent = (this.strokeWidth / this.textSize * 150); attribs.setStrokeWidth(strokeWidthPercent); NSAttributedString attributedString = new NSAttributedString(text, attribs);