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

Feat: Implemented keyboard shortcut Alt to perform a centered resize #6586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LeonardoAlvess
Copy link
Contributor

While holding the Alt key and resizing an instance, both sides are
resized. This was achieved by doubling the scaling factor and
updating the new X and Y coordinates without using a fixedPoint.
Closes issue #6160

While holding the Alt key and resizing an instance, both sides are
 resized. This was achieved by doubling the scaling factor and
 updating the new X and Y coordinates without using a fixedPoint.
Closes issue 4ian#6160

Co-authored-by:  David Palma <david.palma@tecnico.ulisboa.pt>
@LeonardoAlvess LeonardoAlvess requested a review from 4ian as a code owner May 23, 2024 15:46
@@ -210,14 +211,17 @@ export default class InstancesResizer {
: roundedTotalDeltaX;
const flippedTotalDeltaY = isTop ? -roundedTotalDeltaY : roundedTotalDeltaY;

// While rezising both sides, TotalDelta must be doubled
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// While rezising both sides, TotalDelta must be doubled
// While resizing both sides, TotalDelta must be doubled.

@@ -210,14 +211,17 @@ export default class InstancesResizer {
: roundedTotalDeltaX;
const flippedTotalDeltaY = isTop ? -roundedTotalDeltaY : roundedTotalDeltaY;

// While rezising both sides, TotalDelta must be doubled
const altOffset = centeredResize ? 2 : 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

altOffset is not very meaningful as a variable name. Can you think of something that represents this factor?

@AlexandreSi
Copy link
Collaborator

Thanks for the suggestion!
It works like a charm for sprites and tiled sprites, but with 3D models, there are some strange behaviors (it depends on the model default X rotation).
Have you tried with other object types ? (Panel sprite, tilemaps for instance)

@LeonardoAlvess
Copy link
Contributor Author

Hi! Thanks for the review.
We just reviewed the interaction with other object types and there is in fact a buggy interaction, we will get right on it and get a solution as soon as possible!

@LeonardoAlvess
Copy link
Contributor Author

Could you clarify the what you mean by "depends on the default X rotation?".

@AlexandreSi
Copy link
Collaborator

AlexandreSi commented May 27, 2024

Here is a video to reproduce the particular issue I saw:

demo_bug_alt_resize_3D_model.mov

Depending on the Default X Rotation, the point that does not move is never the same 😅

@DavidMLPalma
Copy link
Contributor

Hi @AlexandreSi,
Thanks for the explanation! We will try to get on it as soon as possible.

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.

None yet

3 participants