You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to continue drawing a line between stage updates.
Unfortunately, invoking a second lineTo after a stage update seems to reset the StrokeStyle for all line segments.
Here's an example.
Removing the first stage.update() results in two thick line segments as expected.
Removing the second lineTo results in one thick line as expected.
Running the code as is results in two thin segments.
Is this by design? If so, is there a way to continue a line while preserving style between stage updates (other than recalling setStrokeStyle, beginStroke and moveTo)?
<script src="https://code.createjs.com/easeljs-0.8.2.min.js"></script>
<canvas id="canvas" width="300" height="300"></canvas>
<script>
var stage = new createjs.Stage('canvas');
var shape = new createjs.Shape();
stage.addChild(shape);
shape.graphics.setStrokeStyle(10);
shape.graphics.beginStroke('#f90');
shape.graphics.moveTo(0, 0);
shape.graphics.lineTo(50, 100);
stage.update();
shape.graphics.lineTo(100, 0);
stage.update();
</script>
The text was updated successfully, but these errors were encountered:
Hi!
I want to continue drawing a line between stage updates.
Unfortunately, invoking a second lineTo after a stage update seems to reset the StrokeStyle for all line segments.
Here's an example.
Removing the first stage.update() results in two thick line segments as expected.
Removing the second lineTo results in one thick line as expected.
Running the code as is results in two thin segments.
Is this by design? If so, is there a way to continue a line while preserving style between stage updates (other than recalling setStrokeStyle, beginStroke and moveTo)?
The text was updated successfully, but these errors were encountered: