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'm using the 0.8.2 version, but I've searched through the changelog and didn't see any changes that might deal with this problem.
UPDATE: In codepen linked below, I also used the 1.0.2 version of EaselJS.
The problem:
When I create any shape (Square in this case) and set its stroke thickness to 0, it still displays the stroke (outline) as it is 1px width. Of course, the workaround is not to set stroke at all, and it won't display any stroke at all, but the problem is that I had to initially set the stroke, so that I would have access to the "command" of it, for a later dynamic change of thickness, color, etc.
I tried using the endStroke() method, but it won't display any stroke on Shape if used, and it also messes up later with my command references for later use.
The workaround with not using the stroke at all (setStrokeStyle and beginStroke) seems ok, as I said, but since I need to change/add the stroke at some point later, I could eventually make it redraw the whole shape with setStrokeStyle and beginStroke if there wasn't any stroke, but also destroy the shape and redraw it again if user of my app decides to reduce thickness back to 0 again.
UPDATE2: There's another even simpler workaround. I found out that the subpixel thickness works by setting the alpha to existing 1px thickness. So, if I do setStrokeStyle(0.1) it will actually be as it's invisible, which completely fixes the problem. I will just set in my app that if the User sets thickness to 0, that it actually drops it to 0.1.
The text was updated successfully, but these errors were encountered:
Oh, thanks @MannyC
Now I also see that the stroke is still visible with 0.1 value (tried editing the ctx.lineWidth on the page you linked), but the 0.01 or even 0.001 surely makes it invisible.
Yes, I know that :) and I explained in my initial description why I needed to set any stroke initially - because the User of my app will be able to change the stroke thickness at some point, so I thought that just setting the initial 0 thickness would work.
I'm using the 0.8.2 version, but I've searched through the changelog and didn't see any changes that might deal with this problem.
UPDATE: In codepen linked below, I also used the 1.0.2 version of EaselJS.
The problem:
When I create any shape (Square in this case) and set its stroke thickness to 0, it still displays the stroke (outline) as it is 1px width. Of course, the workaround is not to set stroke at all, and it won't display any stroke at all, but the problem is that I had to initially set the stroke, so that I would have access to the "command" of it, for a later dynamic change of thickness, color, etc.
Here's the codepen - https://codepen.io/flackjap/pen/WzONgV?editors=1010
I tried using the endStroke() method, but it won't display any stroke on Shape if used, and it also messes up later with my command references for later use.
The workaround with not using the stroke at all (setStrokeStyle and beginStroke) seems ok, as I said, but since I need to change/add the stroke at some point later, I could eventually make it redraw the whole shape with setStrokeStyle and beginStroke if there wasn't any stroke, but also destroy the shape and redraw it again if user of my app decides to reduce thickness back to 0 again.
UPDATE2: There's another even simpler workaround. I found out that the subpixel thickness works by setting the alpha to existing 1px thickness. So, if I do setStrokeStyle(0.1) it will actually be as it's invisible, which completely fixes the problem. I will just set in my app that if the User sets thickness to 0, that it actually drops it to 0.1.
The text was updated successfully, but these errors were encountered: