Skip to content

Commit a8e193e

Browse files
authored
Merge pull request #1672 from BioniCosmos/main
Fix canvas render on web target
2 parents f91bb54 + 32b1edb commit a8e193e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

paint/renderers/htmlcanvas/htmlcanvas.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (rs *Renderer) PopContext(pt *render.ContextPop) {
104104
}
105105

106106
func (rs *Renderer) setTransform(ctx *render.Context) {
107-
m := ctx.Transform
107+
m := ctx.Cumulative
108108
rs.ctx.Call("setTransform", m.XX, m.YX, m.XY, m.YY, m.X0, m.Y0)
109109
}
110110

paint/renderers/htmlcanvas/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (rs *Renderer) RenderPath(pt *render.Path) {
5757
rs.ctx.Call("fill", style.Fill.Rule.String())
5858
}
5959
if style.HasStroke() {
60-
scale := math32.Sqrt(math32.Abs(pt.Context.Transform.Det()))
60+
scale := math32.Sqrt(math32.Abs(pt.Context.Cumulative.Det()))
6161
if scale != 1 {
6262
// note: this is a hack to get the effect of [ppath.VectorEffectNonScalingStroke]
6363
stk := style.Stroke

0 commit comments

Comments
 (0)