Skip to content

Conversation

@Annonnymmousss
Copy link
Contributor

@Annonnymmousss Annonnymmousss commented Dec 24, 2025

fix the global state showcase when grabbed even after rotating with an angle
code todo - https://discord.com/channels/731730685944922173/881073965047636018/1399533117441835080

Screen.Recording.2025-12-24.at.6.13.43.AM.1.mov

@Keavon kindly review this

didnt got the issue no.

Comment on lines 568 to 578
let viewport_delta = input.mouse.position - self.mouse_position;
let document_space_transform = self.initial_transform * document_to_viewport.inverse();
let delta_pos = if self.state.is_transforming_in_local_space {
let [local_x_axis, local_y_axis] = self.state.local_transform_axes;
let local_components = DVec2::new(viewport_delta.dot(local_x_axis), viewport_delta.dot(local_y_axis));
document_space_transform.matrix2 * local_components
} else {
document_space_transform.transform_vector2(viewport_delta)
};
let scale = document_to_viewport.y_axis.length();
let delta_scaled = (if self.slow { delta_pos / SLOWING_DIVISOR } else { delta_pos }) / scale;
Copy link
Contributor

Choose a reason for hiding this comment

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

Along with adding significant complexity here, you have also broken the «local x-axis constraint» feature (press G to grab then press X twice.

broken_local_grab.mp4

I don't see why there should be any changes to the functionality of the system, since the issue concerned only changing the overlays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

letme try this again

@Annonnymmousss
Copy link
Contributor Author

this solved the constraint breakage but now every scale is getting calculated with reference to global axis only
can you help me?

@0HyperCube
Copy link
Contributor

scale is getting calculated with reference to global axis only

The scale by pressing key S then X will scale in viewport space. Pressing X again will scale in local space. This is the intended behaviour.

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.

3 participants