Prevent block invalidation due to missing width/height#2557
Prevent block invalidation due to missing width/height#2557swissspidy merged 8 commits intodevelopfrom
Conversation
|
Looks like the Edit: these |
|
@kienstra since this whole position adjustment for text blocks is something you have implemented, you are probably better suited for looking at this. |
|
Sure, I'll work on this, though I'm not sure if I'll be able to fix it 😄 |
|
I can take a look as well. |
…ming null It looks like on resizing, these attributes become null.
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
|
@swissspidy Could you test if it works OK now? |
|
@miina If I position a block somewhere, and then increase its height like 20 times, it moves a bit to the the top every time. Demo: https://cloudup.com/c_kA2ebgcre |
|
@swissspidy That should be fixed within 544d2c8 now. Found another issue though that's occurring now -- when the block is rotated it's quite "jumpy" when resizing. It looks like the reason is using integers for top and left positioning and ignoring the decimals. We should probably rework this to use decimals as we're doing for the width and height already. Not sure if it's better to do it within this PR or separately. Perhaps separately since it's not necessarily a blocker for RC. Thoughts? |
|
@miina You added some |
I added the Math.round calls since the top and left attributes were saved without decimals. Since the resizing itself was using the decimals then the difference between the saved value and the displayed value was causing the position to shift when resizing (even without rotation). Now the displayed position reflects the saved value accurately and doesn't jump anymore when resizing. However, having an angle requires the top and left also to be changed during resizing and now it's more "jumpy" since the displayed value isn't using decimals anymore. I will look more into the jumpiness issue, not sure how much time it'll take. Hopefully, it'll be quite straightforward. If it's OK not to merge this fix yet for the Text block then I'll just continue within this PR. |
|
Alright, rounding is removed now. Would you mind testing again, @swissspidy? |
swissspidy
left a comment
There was a problem hiding this comment.
Seems to work well now.
Left a comment about the position block attributes.
Cannot approve my own PR, so someone else would have to do that :)
Just approved the PR, if removing the type from position attributes is OK for you then let's merge. |
kienstra
left a comment
There was a problem hiding this comment.
Approved
Hi @miina and @swissspidy,
Thanks a lot for fixing this.
Now, resizing the text block doesn't cause a validation error. Dragging also works well:
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |


Fixes #2556