Skip to content

feat(chaosymmetry): implemented adjustable multiplier for zooming and panning commands#9

Open
ElkeVSant wants to merge 1 commit intomasterfrom
feat/adjustable-commands
Open

feat(chaosymmetry): implemented adjustable multiplier for zooming and panning commands#9
ElkeVSant wants to merge 1 commit intomasterfrom
feat/adjustable-commands

Conversation

@ElkeVSant
Copy link
Copy Markdown
Collaborator

Implemented commands à la vim, where a numerical factor can be typed in before a command (zooming or panning) to apply it multiple times. Multiple digits can be typed in. The multiplier is valid for 5 seconds, after which it resets. The multiplier also resets after a command is executed, or any other not (yet) supported key is pressed. Saving the image as a .png file also resets the multiplier, although the multiplier has no effect on that action.

@ElkeVSant ElkeVSant requested a review from OliverHofkens May 28, 2025 15:22
@ElkeVSant ElkeVSant force-pushed the feat/adjustable-commands branch from d5d4e47 to 08f2580 Compare May 28, 2025 15:30
window: Option<Arc<Window>>,
pixels: Option<Pixels<'static>>,
render: Renderer,
mult: Mult,
Copy link
Copy Markdown
Owner

@OliverHofkens OliverHofkens May 29, 2025

Choose a reason for hiding this comment

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

Aangezien dit in de App zit zou ik de struct iets generieker noemen, bv:

InputState {
    buffer: String,
    last_input: Instant
}

Dan kunnen we dat nog voor andere zaken ook gebruiken, terwijl Mult impliceert dat er maar 1 functie is voor inputs.

&& event.state.is_pressed()
if event.state.is_pressed()
// Since "+" requires pressing "Shift", this would otherwise reset the multiplier to "1" before zooming in
&& event.logical_key != Key::Named(winit::keyboard::NamedKey::Shift)
Copy link
Copy Markdown
Owner

@OliverHofkens OliverHofkens May 29, 2025

Choose a reason for hiding this comment

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

Dit kunnen we denk ik nog wel wat refactoren:

En aangezien de is_pressed() nu buiten staat kunnen we hier wel overwegen om een grote match statement te maken. Da gaat properder zijn en geeft veel opties door de flexibiliteit van de syntax in match statements.

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.

2 participants