iOS: fix text drawing with stroke width (#441)
This commit is contained in:
parent
f94c665b27
commit
0a7638e10d
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user