Skip to content

fix: Modified the scale factor of clicks#10

Open
jackfruitdog wants to merge 1 commit intoswe-productivity:masterfrom
jackfruitdog:fix-small-select-tool-click-target
Open

fix: Modified the scale factor of clicks#10
jackfruitdog wants to merge 1 commit intoswe-productivity:masterfrom
jackfruitdog:fix-small-select-tool-click-target

Conversation

@jackfruitdog
Copy link
Copy Markdown

My apologies. This is the same commit from before, just with tests. I added tests after the fact and ended messing up the commit history. So I had to resubmit.
Closes #8
Used the scale factor of the viewport in order to modify the size of each click.

Recording 2026-01-21 at 18 47 20

@timon-schelling timon-schelling force-pushed the master branch 2 times, most recently from fce5cc1 to 1e8e6f8 Compare February 5, 2026 09:40
self.intersect_path(|| inflated_quad.to_lines(), layer_transform)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please run fmt

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

assert!(cache.try_read(rotation2, scale, translation, fp2).is_none());
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make the error messages sligtly more meaningfull.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Comment thread node-graph/libraries/vector-types/src/vector/click_target.rs
let target_bounds = [point - DVec2::splat(self.stroke_width / 2.), point + DVec2::splat(self.stroke_width / 2.)];
const MINIMUM_INFLATION: f64 = 5.;
let base_inflation = self.stroke_width / 2.;
let target_bounds = match base_inflation < MINIMUM_INFLATION {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would replace this with if

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

let translation = DVec2::new(20., 30.);
let transform = DAffine2::from_scale_angle_translation(scale, rotation, translation);

let point_one = transform.transform_point2(DVec2::new(100., 50.));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would prefere point1 etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

@timon-schelling timon-schelling self-assigned this Feb 5, 2026
@jackfruitdog jackfruitdog force-pushed the fix-small-select-tool-click-target branch from 3e0cb51 to 298a6b2 Compare February 10, 2026 15:59
@timon-schelling
Copy link
Copy Markdown
Collaborator

Thanks, LGTM, @jackfruitdog feel free to rebase and submit to the main repo after the study :)

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.

Small click target when dragging/moving a straight line or small objects

2 participants