Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stage.update() resets StrokeStyle #827

Closed
xathis opened this issue Dec 15, 2016 · 2 comments
Closed

stage.update() resets StrokeStyle #827

xathis opened this issue Dec 15, 2016 · 2 comments

Comments

@xathis
Copy link

xathis commented Dec 15, 2016

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)?

<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>
@lannymcnie
Copy link
Member

Related to #730

@lannymcnie
Copy link
Member

#730 is closed. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants