-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix problem on fabric.Line controls and line.getWidth() #3742
Conversation
it has to be like that. |
6f2cbdc
to
b8f6f98
Compare
I made the changes. |
i m working a bit on it. there are problems.here and there importing svgs with lines. i ll push up changes asap |
To me the changes i committed to your branch looks like are fixing all cases ( horizontal line, vertical line, svg import ) |
<svg width="120" height="120" viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<line x1="15" y1="15" x2="100" y2="15"
stroke-width="30" stroke="black" stroke-linecap="round" />
<line x1="0" y1="47" x2="115" y2="47"
stroke-width="30" stroke="black" stroke-linecap="butt" />
<line x1="8" y1="79" x2="115" y2="150"
stroke-width="30" stroke="red" stroke-linecap="butt" />
</svg> |
Please check them, i will merge them once you figure out if they solve what you noticed wrong. |
Last changes solved the problem except for stroke-linecap="round" |
what is that fiddle? i see a snake growing. where is the problem? |
if you refer to the fact that getwidth is bigger than width, that is because getWidth should be named differently. i will just remove that method. |
getWidth return the actual width, including scaling, skewing. is just a wrong named method. it was a shortcut to get width * scaleX, now is a shortcut for getNonTransformedDimensions().x and soon removed. we should merge this PR i think |
* feat(pr/fixLineWidth) Fix problem on fabric.Line controls and line.getWidth() * fix line boxes and svg import
There is a bug when creating a fabric.Line + strokeWidth.
DEMO MASTER BRANCH
DEMO WITH FIX