GraphiteEditor / GraphiteEditor/Graphite

Add modal tool states with the eyedropper, and implement pixel sampling in the color picker popover

Ouverte
#832 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Web
Langage dominant
Rust
Étoiles
27.2k
Forks
1.3k
Merge moyen
20 h 5 min
PR mergées (30 j)
57

Description

A "modal tool state" is a temporary state where a tool can present a simple mouse-based interaction, which takes precedence over the active tool. It shows hints, a custom cursor, and can direct messages on the different events (mousedown, mousemove, mouseup, keyboard modifiers, and keyboard events).

The first example, which this issue covers, is the eyedropper modal tool state. This should be activated by clicking the eyedropper icon in the ColorPicker.svelte popover. Also, the existing Eyedropper tool (accessible in the tool shelf as a full-blown tool) should, upon clicking with LMB or RMB, activate this modal tool to reuse its code. The modal tool state will need the current mouse position every frame it's moved (mousemove event) so it can send a `FrontendMessage::UpdateEyedropperSamplingState` message with the canvas position and other details. For this one, hitting Escape should exit the modal tool state and return back to whatever viewport tool the user was doing, in whatever state it was in.

Other future modal tool states, to provide some examples to understand how this feature will be used:
- "Pick a layer to reference" (in the Properties panel for a particular node that needs the input of another node/layer as a reference, Blender has something similar for picking a specific 3D object to reference when setting up shader nodes or other things)
- "Quick export" where you press a hotkey and drag a rectangle to instantly download a "screenshot" of that part of the canvas
- "Paste style" where you right click an object, click *Copy/Paste Style* from the context menu, and your cursor becomes a paste modal where you click on an object to paste the copied style on it as a target
- Other things where you hit a hotkey to enter the mode briefly and can use your mouse to interact on a temporary basis, usually where Escape exits the mode and returns to whatever actual tool you were using

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.