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: duplicate offset taking into account snap #1283

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Doublonmousse
Copy link
Collaborator

If snap is activated, the offset is one exactly the size of one grid element, and if not, uses the previous value.

Fixes #1245

We could do fancier things there. Always take into account the grid size (but switch based on whether the grid is visible or not). Or do an offset based on content (find a place that does not overlap with what's already there if possible)

If snap is activated, the offset is one exactly the size of one grid element, and if not, uses the previous value.
self.translate_strokes_images(&new_selected, Stroke::IMPORT_OFFSET_DEFAULT);
// check if snap position is activated or not here
let offset = if snap_mode {
pattern_size
Copy link
Owner

Choose a reason for hiding this comment

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

It often is the case that the selection is not snapped to the grid even when snap_positions is active.
It would be better if the logic does not simply use the grid's size as offset but actively snap the duplicated selection
to the grid when it is active (maybe "default offset" + nearest grid edge?).

@Doublonmousse Doublonmousse marked this pull request as draft December 14, 2024 14:42
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.

"Duplicate Selection" moves objects not by a multiple snapping-distance
2 participants