Skip to content
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

[Bug]: Rotating, then scaling produces poor results. #518

Open
1 task done
vi opened this issue Nov 1, 2023 · 5 comments
Open
1 task done

[Bug]: Rotating, then scaling produces poor results. #518

vi opened this issue Nov 1, 2023 · 5 comments
Assignees
Labels
bug Something isn't working confirmed good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vi
Copy link

vi commented Nov 1, 2023

What happened?

badselect2.webm

Version

2.0.0-beta.14

Platform

Web

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@vi vi added the bug Something isn't working label Nov 1, 2023
@github-project-automation github-project-automation bot moved this to 📕 Todo in Butterfly Nov 1, 2023
@CodeDoctorDE CodeDoctorDE added this to the 2.0 milestone Nov 1, 2023
@CodeDoctorDE
Copy link
Member

This is the function that needs to be fixed: https://github.com/LinwoodDev/Butterfly/blob/develop/app/lib/renderers/renderer.dart#L174

The public transform function should try to remove the rotation out of the evaluation and then call the private _transform function with the unrotated values.

@Luciogi
Copy link
Contributor

Luciogi commented Sep 27, 2024

#742
looks similar

@CodeDoctorDE
Copy link
Member

CodeDoctorDE commented Oct 30, 2024

I tried everything but didn't get it working. I will post this here if anyone find a solution:
image
I'm currently searching for an algorithm to calculate the real scale I need to apply to the rectangle + the offset.

We have given a rotation of the rectangle, the real rectangle (green with x, y, width and height), the expanded rectangle (red with x, y, width and height) and a scale that needs to be applied.
scaleX = 1 and scaleY = 1 is the default and should not change anything.

The output should be the offset position and the updated scaleX and scaleY values.

Feel free to change the given line: https://github.com/LinwoodDev/Butterfly/blob/f18fe8f641ad19a988ad4e95c39d1e34244c31f4/app/lib/renderers/renderer.dart#L229-L255and make a pull request.
Alternatively you could post the formular here and I can translate it into the app

@github-project-automation github-project-automation bot moved this from 📕 Todo to ✅ Done in Butterfly Oct 30, 2024
@CodeDoctorDE
Copy link
Member

okay, after thinking a bit, i think i've fixed it, try it out at https://preview.butterfly.linwood.dev and comment here if you find any things i've missed

@CodeDoctorDE CodeDoctorDE reopened this Oct 30, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to 🚧 In Progress in Butterfly Oct 30, 2024
@CodeDoctorDE
Copy link
Member

or not... I will try it again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: 🚧 In Progress
Development

No branches or pull requests

3 participants