iOS: fix text drawing with stroke width (#441)

This commit is contained in:
Andre Höpfner 2017-11-10 09:38:08 +01:00 committed by Emux
parent f94c665b27
commit 0a7638e10d
2 changed files with 1 additions and 3 deletions

View File

@ -76,8 +76,6 @@ public class IosCanvas implements Canvas {
IosPaint iosFill = (IosPaint) fill; IosPaint iosFill = (IosPaint) fill;
if (stroke != null) { if (stroke != null) {
IosPaint iosStroke = (IosPaint) stroke; IosPaint iosStroke = (IosPaint) stroke;
iosFill.setStrokeWidth(iosStroke.strokeWidth);
iosFill.setStrokeColor(iosStroke.getColor());
iosStroke.drawLine(this.cgBitmapContext, string, x, y); iosStroke.drawLine(this.cgBitmapContext, string, x, y);
} }
iosFill.drawLine(this.cgBitmapContext, string, x, y); iosFill.drawLine(this.cgBitmapContext, string, x, y);

View File

@ -194,7 +194,7 @@ public class IosPaint implements Paint {
!!!!! !!!!!
NOTE: The value of NSStrokeWidthAttributeName is interpreted as a percentage of the font point size. 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); attribs.setStrokeWidth(strokeWidthPercent);
NSAttributedString attributedString = new NSAttributedString(text, attribs); NSAttributedString attributedString = new NSAttributedString(text, attribs);