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
Labels

Comments

@xathis
Copy link

@xathis 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

This comment has been minimized.

Copy link
Member

@lannymcnie lannymcnie commented Jan 1, 2017

Related to #730

@lannymcnie lannymcnie added the duplicate label Jan 1, 2017
@lannymcnie

This comment has been minimized.

Copy link
Member

@lannymcnie lannymcnie commented Nov 21, 2018

#730 is closed. Closing this.

@lannymcnie lannymcnie closed this Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.