Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions haxe/ui/backend/ComponentGraphicsImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class ComponentGraphicsImpl extends ComponentGraphicsBase {
super.fillStyle(color, alpha);
_impl.fillStyle(color, alpha);
}

public override function fontStyle(size:Null<Int>, family:Null<String> = null, anchor:Null<String> = null) {
super.fontStyle(size, family, anchor);
_impl.fontStyle(size, family, anchor);
}

public override function text(x:Float, y:Float, t:String) {
super.text(x, y, t);
_impl.text(x, y, t);
}

public override function circle(x:Float, y:Float, radius:Float) {
super.circle(x, y, radius);
Expand Down
13 changes: 13 additions & 0 deletions haxe/ui/backend/html5/graphics/SVGGraphicsImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import haxe.ui.backend.html5.svg.SVGBuilder;
import haxe.ui.backend.html5.svg.SVGPathBuilder;
import haxe.ui.backend.html5.svg.SVGStrokeData;
import haxe.ui.backend.html5.svg.SVGFillData;
import haxe.ui.backend.html5.svg.SVGFontData;
import haxe.ui.core.Component;
import haxe.ui.geom.Point;
import haxe.ui.loaders.image.ImageLoader;
Expand Down Expand Up @@ -67,6 +68,18 @@ class SVGGraphicsImpl extends ComponentGraphicsBase {
currentPath.fill(currentFillStyle);
}
}

public override function fontStyle(size:Null<Int>, family:Null<String> = null, anchor:Null<String> = null) {
var currentFontStyle:SVGFontData = {};
currentFontStyle.size = size;
currentFontStyle.family = family;
currentFontStyle.anchor = anchor;
_svg.currentFontStyle = currentFontStyle;
}

public override function text(x:Float, y:Float, t:String) {
_svg.text(t, x, y);
}

public override function circle(x:Float, y:Float, radius:Float) {
_svg.circle(x, y, radius);
Expand Down