Skip to content

fix: BROS-100: Flip rectangle regions without shift #7760

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

Merged
merged 7 commits into from
Jun 16, 2025

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Jun 13, 2025

If you start resizing Rectangle region from left to right effectively flipping it and if you move the cursor very fast, the region will shift during flip, because Konva.js flips rectangle sides at some point.

Konva.js Transformer has parameter flipEnabled which was disabled. This parameter fixes the issue but it flips the height of the region and also rotates it at some cases.
We have to fix negative height and shift the region back.

Rotation is kept intact except for the two most common cases when it stays 0:

  • when the region is flipped horizontally with no rotation, we fix the rotation back to 0.
  • when the region is flipped vertically, rotation is still 0, we just flip the height.

All other cases might have rotated upside down, but sizes and position are correct, so that's acceptable.

Before:

flipping-rect-before.mov

With flipEnabled but without fix, notice negative height and flipped rotation:

flipping-rect-negative-height.mov

After the fix, height is positive:

flipping-rect-fixed.mov

hlomzik added 2 commits June 13, 2025 12:20
If you start resizing Rectangle region from left to right flipping it
and will move cursor very fast, the region will shift during flip.
Konva.js Transformer has parameter `flipEnabled` which was disabled for some reason.
Enabling it solves shifting issue.
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for label-studio-docs-new-theme ready!

Name Link
🔨 Latest commit a56fc4f
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/68500d5fc28b37000822c471
😎 Deploy Preview https://deploy-preview-7760--label-studio-docs-new-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit a56fc4f
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/68500d5ff5e01900082ba3ac
😎 Deploy Preview https://deploy-preview-7760--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit a56fc4f
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/68500d5ffd04360008824d6c
😎 Deploy Preview https://deploy-preview-7760--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit a56fc4f
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/68500d5f0e4f8500085bbd5d
😎 Deploy Preview https://deploy-preview-7760--heartex-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hlomzik hlomzik changed the title fix: BROS-100: Flip rect fix: BROS-100: Flip rectangle regions without shift Jun 13, 2025
@hlomzik
Copy link
Collaborator Author

hlomzik commented Jun 13, 2025

/fmt

Workflow run

@hlomzik hlomzik requested a review from bmartel June 16, 2025 11:05
@hlomzik
Copy link
Collaborator Author

hlomzik commented Jun 16, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/editor/tests/integration/e2e/timeseries/multichannel.cy.ts

@robot-ci-heartex robot-ci-heartex merged commit eb6af12 into develop Jun 16, 2025
44 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-bros-100/flip-rect branch June 16, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants