Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iamllama
Copy link
Contributor

@iamllama iamllama commented May 7, 2025

Relevant: https://forums.ankiweb.net/t/allow-rotating-io-masks/60336

image

NB1: editing on older clients can be destructive (rotation-wise only), as the angle IO cloze property would be stripped out
NB2: 6d767c4's message is mistakenly misleading, it's not meant to be a full revert of that commit

EDIT: the bounds checking leaves one case unresolved: a thin diagonal rect can have a bounding box large enough that it still remains in the canvas, but the actual rect itself is far enough away as to be hidden. we could check for non-intersection with the canvas, but im not sure where the mask should be moved to. thoughts?

@dae
Copy link
Member

dae commented May 8, 2025

Re the bounds checking, the seems like a rare-enough case that it's probably not worth the effort?

PR looks good. The only thought I had was about the way we're serializing the angle to four decimal places, which is probably more than we need. And once the user has made adjustments, even if they rotate back to what looks like 0, chances are it remains stuck on an angle like 0.05. We could perhaps address the former by normalizing the value to 10k steps, but I'm not sure if it's worth it for a few bytes savings per rotated occlusion.

@iamllama
Copy link
Contributor Author

iamllama commented May 9, 2025

Even with 10k steps its still difficult to get it back to 0. The rounding error doesn't appear to be noticeable at least. Worried about using 10000 as a magic constant though. Perhaps keeping it as degrees but with truncated decimal points would allow for future flexibility

PS: Made a few git mistakes and had to wrestle with it for a bit 😅 no idea how i closed it

@iamllama iamllama force-pushed the io-rotate-mask branch 2 times, most recently from bcd6129 to 899f790 Compare May 9, 2025 01:27
@iamllama iamllama closed this May 9, 2025
@iamllama iamllama reopened this May 9, 2025
@dae
Copy link
Member

dae commented May 10, 2025

I think it might automatically close if the branch becomes empty of new commits? Not sure though. In any case, thank you as always for the improvements, including going the extra step of normalizing those values. :-)

@dae dae merged commit 573f59f into ankitects:main May 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants