-
Notifications
You must be signed in to change notification settings - Fork 235
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
Element.getSize() instead of Element.getComputedSize() in Mask.resize() #1274
base: master
Are you sure you want to change the base?
Conversation
Conflicts: Source/Drag/Drag.Move.js
|
if (this.options.maskMargins) { | ||
dim.x += this.target.getStyle('margin-left').toInt() + this.target.getStyle('margin-right').toInt(); | ||
dim.y += this.target.getStyle('margin-top').toInt() + this.target.getStyle('margin-bottom').toInt(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getComputedSize
does a lot of things, but one of them is that it checks for when the style is auto
. Here you'd get NaN
when you call .toInt()
, I believe, if that's what the style is set to. It also will do this addition for you, telling you what the total margin is on the sides and the top & bottom. Is there a reason you opted to not use it?
If the purpose is to handle the box model stuff, I think all you need to do is change what getComputedSize
measures, as you can configure it to use only the element size, the element size + margins, + margins and padding, + margins, padding, and border, etc.
Any contribution here is always welcome, but before we pull this we'd need to test it. There aren't any specs for Regardless, I'll reiterate that the pull request is most welcome. It may take a short while for us to pull it without the tests so don't fret. |
Just saw your comment here: #1273 (comment) I understand your reasoning for using |
@anutron Yes, I wrote my motivations on #1273 :) Anyway I understand may be better to fix You decide whether to leave my issue and my PR opened, or close them and open a new issue about |
@lorenzos yep. I may not be the one to get to this (either helping with tests or working on element.measure); someone else may beat me to it (my week is rather busy). Will reiterate how much the pull request is appreciated! |
This fixes bad Mask resizing in case target element has a
box-sizing
that is notcontent-box
. See #1273.PS: I don't know why Github is including old commits of mine in this PR, anyway they were already merged before 1.5.0 - and in fact they brings no diffs at all.