Skip to content

The call to svg-renderer._draw in SVGSkin.setSVG isn't necessary #518

@fsih

Description

@fsih

During SVGSkin.setSVG, we call
this._svgRenderer.fromString(svgData, 1, () => {...})
which triggers a call to svg-renderer._draw at a texture scale of 1 (hard-coded).

Milliseconds later, as a part of vm's runtime._step method, we call draw on all drawables, which also calls svg-renderer._draw, this time at the correct texture scale (one that takes into account the device pixel density.) That call to _draw immediately replaces the previous texture.

Here are the 2 stack traces
Screen Shot 2019-10-30 at 15 55 29

This should mean that the first call to _draw with scale 1 is unnecessary. However, setSVG is only happening whenever a user action happens in the paint editor right now, which is not very often (and so probably not a high priority).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions