Punkt-Editoren: Punkt per Doppelklick anlegen, per Auswahl und Delete oder Rechtsklick entfernen #288

Closed
opened 2026-10-01 18:26:23 +02:00 by meleki · 2 comments
Owner

Aus dem Benchmark-Lauf des Engine-Prompts (benchmark/engine-prompt.md, defc34b): Dort legt ein Doppelklick auf die Kurve einen Punkt an. Das gefällt dem User besser als unsere Bedienung, und es soll für alle Punkt-Editoren gleich gelten.

Stand heute

Vier Editoren bearbeiten Punkte, alle nach demselben Muster: ein einfacher Druck auf Linie oder Kante legt einen Punkt an und zieht ihn gleich mit, ein Doppelklick auf einen Punkt nimmt ihn weg.

Editor Datei Anlegen Entfernen Punkt wählbar Delete heute
Curve-Tab src/editor/curve/CurveCanvas.ts Druck auf Linie oder freie Fläche Doppelklick auf Punkt ja (picked) nimmt den gewählten Punkt weg
Vector-Art-Tab src/editor/vectorart/VectorArtCanvas.ts Druck auf Segment Doppelklick auf Punkt ja (pick) löscht die gewählten Formen
Polygon-Collider in der Scene View src/editor/viewport/polygonCorners.ts Druck auf Kante Doppelklick auf Ecke nein löscht das Objekt
Frame-Umriss im Texture-Tab (Collision) src/editor/texture/TextureCanvas.ts Druck auf Kante Doppelklick auf Ecke nein löscht den ganzen Umriss

Ein Kontextmenü auf einem Punkt gibt es in keinem der vier.

Zu bauen (Vorschlag)

  • Anlegen per Doppelklick auf Linie, Kante oder Segment (im Curve-Tab auch auf freie Fläche). Ein einfacher Druck dort legt nichts mehr an.
  • Entfernen über die Auswahl: Ein Klick wählt den Punkt (sichtbar markiert), Delete oder Backspace nimmt ihn weg.
  • Rechtsklick auf einen Punkt öffnet ein Menü mit Delete point. Der Rechtsklick wählt den Punkt dabei.
  • Doppelklick auf einen Punkt entfernt ihn nicht mehr.
  • Die gemeinsame Regel als reine Funktion, damit alle vier Editoren dieselbe benutzen (heute teilen sie polygonEdit.ts bzw. die Ring-Helfer).
  • Die Grenzen bleiben: Ein Polygon behält drei Ecken, die Enden einer Kurve bleiben stehen. Das Menü zeigt den Eintrag dann gesperrt oder gar nicht.
  • Hinweiszeilen in den Tabs und das Wiki (Curves, Colliders, Textures, Vector Art, Keyboard) nachziehen.

Offene Fragen

  1. Delete mit gewähltem Punkt: Vorschlag: Ist ein Punkt gewählt, nimmt Delete den Punkt weg, sonst wie bisher die Form, das Objekt oder den Umriss. Passt das, oder soll Delete in der Scene View nie etwas anderes als das Objekt löschen?
  2. Wann endet die Punkt-Auswahl? Vorschlag: bei einem Klick ins Leere, beim Wechsel des Objekts bzw. der Form und nach dem Entfernen.
  3. Anlegen und Ziehen in einer Geste fällt weg (erst Doppelklick, dann ziehen). Soll der zweite Druck des Doppelklicks den neuen Punkt gleich mitziehen können, wenn die Taste gehalten bleibt?
  4. Alt+Klick (Punkt rund oder eckig) im Curve- und Vector-Art-Tab bleibt wie es ist. Soll der Eintrag zusätzlich ins neue Menü?
  5. Curve-Tab, freie Fläche: Heute legt ein Druck daneben einen Punkt an. Bleibt das per Doppelklick, oder nur noch auf der Linie?

Tests (Vorschlag)

  • Unit für die gemeinsame Regel: Doppelklick auf Kante legt an, einfacher Druck nicht, Delete trifft den gewählten Punkt und sonst das bisherige Ziel, die Grenzen (drei Ecken, Kurvenenden) halten.
  • e2e je Editor mit echter Maus: Doppelklick legt an, Auswahl plus Delete entfernt, Rechtsklick → Delete point entfernt, je ein Undo-Schritt. Betroffen sind die Module zu Curves (53), Collidern (42), Texturen und Vector Art, die heute den einfachen Druck und den Doppelklick benutzen.
Aus dem Benchmark-Lauf des Engine-Prompts (`benchmark/engine-prompt.md`, `defc34b`): Dort legt ein Doppelklick auf die Kurve einen Punkt an. Das gefällt dem User besser als unsere Bedienung, und es soll für alle Punkt-Editoren gleich gelten. ## Stand heute Vier Editoren bearbeiten Punkte, alle nach demselben Muster: **ein einfacher Druck** auf Linie oder Kante legt einen Punkt an und zieht ihn gleich mit, ein **Doppelklick** auf einen Punkt nimmt ihn weg. | Editor | Datei | Anlegen | Entfernen | Punkt wählbar | `Delete` heute | |---|---|---|---|---|---| | Curve-Tab | `src/editor/curve/CurveCanvas.ts` | Druck auf Linie oder freie Fläche | Doppelklick auf Punkt | ja (`picked`) | nimmt den gewählten Punkt weg | | Vector-Art-Tab | `src/editor/vectorart/VectorArtCanvas.ts` | Druck auf Segment | Doppelklick auf Punkt | ja (`pick`) | löscht die gewählten **Formen** | | Polygon-Collider in der Scene View | `src/editor/viewport/polygonCorners.ts` | Druck auf Kante | Doppelklick auf Ecke | nein | löscht das **Objekt** | | Frame-Umriss im Texture-Tab (Collision) | `src/editor/texture/TextureCanvas.ts` | Druck auf Kante | Doppelklick auf Ecke | nein | löscht den ganzen **Umriss** | Ein Kontextmenü auf einem Punkt gibt es in keinem der vier. ## Zu bauen (Vorschlag) - **Anlegen per Doppelklick** auf Linie, Kante oder Segment (im Curve-Tab auch auf freie Fläche). Ein einfacher Druck dort legt nichts mehr an. - **Entfernen über die Auswahl:** Ein Klick wählt den Punkt (sichtbar markiert), `Delete` oder `Backspace` nimmt ihn weg. - **Rechtsklick auf einen Punkt** öffnet ein Menü mit *Delete point*. Der Rechtsklick wählt den Punkt dabei. - **Doppelklick auf einen Punkt** entfernt ihn nicht mehr. - Die gemeinsame Regel als reine Funktion, damit alle vier Editoren dieselbe benutzen (heute teilen sie `polygonEdit.ts` bzw. die Ring-Helfer). - Die Grenzen bleiben: Ein Polygon behält drei Ecken, die Enden einer Kurve bleiben stehen. Das Menü zeigt den Eintrag dann gesperrt oder gar nicht. - Hinweiszeilen in den Tabs und das Wiki (*Curves*, *Colliders*, *Textures*, *Vector Art*, *Keyboard*) nachziehen. ## Offene Fragen 1. **`Delete` mit gewähltem Punkt:** Vorschlag: Ist ein Punkt gewählt, nimmt `Delete` den Punkt weg, sonst wie bisher die Form, das Objekt oder den Umriss. Passt das, oder soll `Delete` in der Scene View nie etwas anderes als das Objekt löschen? 2. **Wann endet die Punkt-Auswahl?** Vorschlag: bei einem Klick ins Leere, beim Wechsel des Objekts bzw. der Form und nach dem Entfernen. 3. **Anlegen und Ziehen in einer Geste** fällt weg (erst Doppelklick, dann ziehen). Soll der zweite Druck des Doppelklicks den neuen Punkt gleich mitziehen können, wenn die Taste gehalten bleibt? 4. **`Alt`+Klick** (Punkt rund oder eckig) im Curve- und Vector-Art-Tab bleibt wie es ist. Soll der Eintrag zusätzlich ins neue Menü? 5. **Curve-Tab, freie Fläche:** Heute legt ein Druck daneben einen Punkt an. Bleibt das per Doppelklick, oder nur noch auf der Linie? ## Tests (Vorschlag) - Unit für die gemeinsame Regel: Doppelklick auf Kante legt an, einfacher Druck nicht, `Delete` trifft den gewählten Punkt und sonst das bisherige Ziel, die Grenzen (drei Ecken, Kurvenenden) halten. - e2e je Editor mit echter Maus: Doppelklick legt an, Auswahl plus `Delete` entfernt, Rechtsklick → *Delete point* entfernt, je ein Undo-Schritt. Betroffen sind die Module zu Curves (53), Collidern (42), Texturen und Vector Art, die heute den einfachen Druck und den Doppelklick benutzen.
admin added this to the Development project 2026-10-01 18:31:49 +02:00
admin moved this to Next in Development on 2026-10-01 18:32:02 +02:00
  1. vorschlag passt
  2. vorschlag passt
  3. doppelklick erstellt den punkt, dann nur selektiert, erst nachloslassen behandelbar (move by drag)
  4. ja kann bleiben, kann aber auch ins menü
  5. doppelklick auf freie fläche legt punkt an (anstelle von single klick), nicht nur auf der linie
1. vorschlag passt 2. vorschlag passt 3. doppelklick erstellt den punkt, dann nur selektiert, erst nachloslassen behandelbar (move by drag) 4. ja kann bleiben, kann aber auch ins menü 5. doppelklick auf freie fläche legt punkt an (anstelle von single klick), nicht nur auf der linie
Author
Owner

Done in 0f85476, wiki f9b11df (Curves, Colliders, Textures, Vector Art, Keyboard, Development).

What changes
All four point editors now work the same way: the Curve tab, the Vector art tab, a polygon collider in the scene view and a frame's collision outline in the Texture tab.

  • Add: a double-click on a line, edge or segment puts a point there, in the Curve tab on free space too (point 5). The point is picked and stays in place. It can be dragged with the next press (point 3).
  • Pick: a click on a point picks it, and it is drawn filled. A double-click on a point takes nothing away any more.
  • Remove: Delete or Backspace takes the picked point away. Without a picked point the key removes the shape, the object or the outline as before (point 1).
  • Right-click on a point: it picks the point and opens a menu with Delete point. In the Curve and Vector art tab the four point types stand below it, and Alt+click stays (point 4).
  • Limits: a polygon keeps three corners, a curve keeps its ends. The entry is greyed out then.
  • The pick ends with a click beside the points, with another object, shape or frame, and after the point is gone (point 2).

Decided here

  • A single click on a line no longer adds anything:
    • Vector art: it drags the shape, like a click into its fill.
    • Polygon: it only drops the pick.
    • Texture: it makes that outline the active one and drops the pick.
  • Texture tab, drawing an outline: a click inside the frame still appends a corner, as the Pen does, and that corner is picked. Delete takes the last corner first. To remove the whole outline, click one of its edges before.
  • Pen in the Vector art tab: the point put down last is picked, so Delete takes it and not the shape.
  • Delete hits the picked point also when the tab has lost the keyboard focus, after a click in the shape list or after the menu.
  • A vector shape that loses its last point is removed whole. Before, an empty shape stayed in the list.

Under the hood

  • src/editor/pointGestures.ts holds the rule as a pure function, src/editor/pointMenu.ts builds the menu. All four editors use both.
  • Editor.ts and shortcuts.ts ask the open point editor first before Delete reaches the selection.

Tests (on melektaus-atx)

gate        200 files, 2967 tests, CHECK EXIT 0 (2944 + 23)
e2e (full)  ALL PASSED - 1629 checks, E2E EXIT 0 (1625 + 4)
smokes      24 / 19 / 21, SMOKES EXIT 0
  • The full run was done because Delete is global and the right-click in the scene view is touched. After it an unused parameter and a comment were tidied. For that final state the gate and e2e 42,47,53 (105 checks) ran again, the full run did not.
  • 23 unit tests in tests/editor/point-gestures.test.ts, for the rule and for each of the four editors.
  • Four e2e checks with a real mouse: two in module 42, one each in 47 and 53. The existing checks for adding and removing a point use the new gestures.
  • Three screenshots looked at: the picked corner or point is filled. None of the Vector art tab.
Counter-check Result
20 in the unit tests all work, 1 to 10 tests fail each
Browser, without the Delete wiring the key removes the collider instead of the corner
Browser, without the right-click hook the menu is missing
  • The unit counter-checks ran on stein2, not in the container. The build went through for both browser ones.
  • The second browser counter-check stops at the first missing menu in module 42. Modules 47 and 53 were not reached with it.
  • The 1625 before this change are measured (CI run 278 for 1aa824e is green). The CI run for 0f85476 was not waited for.

Findings

  • Fixed: the new hint line in the Texture tab was too long and was cut off at the edge. The shorter text was not looked at in a picture again.
  • Not fixed: in the scene view the collider's name label covers a corner that sits near the centre. That was so before.
Done in `0f85476`, wiki `f9b11df` (*Curves*, *Colliders*, *Textures*, *Vector Art*, *Keyboard*, *Development*). **What changes** All four point editors now work the same way: the Curve tab, the Vector art tab, a polygon collider in the scene view and a frame's collision outline in the Texture tab. - **Add:** a double-click on a line, edge or segment puts a point there, in the Curve tab on free space too (point 5). The point is picked and stays in place. It can be dragged with the next press (point 3). - **Pick:** a click on a point picks it, and it is drawn filled. A double-click on a point takes nothing away any more. - **Remove:** `Delete` or `Backspace` takes the picked point away. Without a picked point the key removes the shape, the object or the outline as before (point 1). - **Right-click on a point:** it picks the point and opens a menu with *Delete point*. In the Curve and Vector art tab the four point types stand below it, and `Alt`+click stays (point 4). - **Limits:** a polygon keeps three corners, a curve keeps its ends. The entry is greyed out then. - **The pick ends** with a click beside the points, with another object, shape or frame, and after the point is gone (point 2). **Decided here** - A single click on a line no longer adds anything: - Vector art: it drags the shape, like a click into its fill. - Polygon: it only drops the pick. - Texture: it makes that outline the active one and drops the pick. - Texture tab, drawing an outline: a click inside the frame still appends a corner, as the Pen does, and that corner is picked. `Delete` takes the last corner first. To remove the whole outline, click one of its edges before. - Pen in the Vector art tab: the point put down last is picked, so `Delete` takes it and not the shape. - `Delete` hits the picked point also when the tab has lost the keyboard focus, after a click in the shape list or after the menu. - A vector shape that loses its last point is removed whole. Before, an empty shape stayed in the list. **Under the hood** - `src/editor/pointGestures.ts` holds the rule as a pure function, `src/editor/pointMenu.ts` builds the menu. All four editors use both. - `Editor.ts` and `shortcuts.ts` ask the open point editor first before `Delete` reaches the selection. **Tests** (on `melektaus-atx`) ``` gate 200 files, 2967 tests, CHECK EXIT 0 (2944 + 23) e2e (full) ALL PASSED - 1629 checks, E2E EXIT 0 (1625 + 4) smokes 24 / 19 / 21, SMOKES EXIT 0 ``` - The full run was done because `Delete` is global and the right-click in the scene view is touched. After it an unused parameter and a comment were tidied. For that final state the gate and e2e `42,47,53` (105 checks) ran again, the full run did not. - 23 unit tests in `tests/editor/point-gestures.test.ts`, for the rule and for each of the four editors. - Four e2e checks with a real mouse: two in module 42, one each in 47 and 53. The existing checks for adding and removing a point use the new gestures. - Three screenshots looked at: the picked corner or point is filled. None of the Vector art tab. | Counter-check | Result | |---|---| | 20 in the unit tests | all work, 1 to 10 tests fail each | | Browser, without the Delete wiring | the key removes the collider instead of the corner | | Browser, without the right-click hook | the menu is missing | - The unit counter-checks ran on stein2, not in the container. The build went through for both browser ones. - The second browser counter-check stops at the first missing menu in module 42. Modules 47 and 53 were not reached with it. - The 1625 before this change are measured (CI run 278 for `1aa824e` is green). The CI run for `0f85476` was not waited for. **Findings** - Fixed: the new hint line in the Texture tab was too long and was cut off at the edge. The shorter text was not looked at in a picture again. - Not fixed: in the scene view the collider's name label covers a corner that sits near the centre. That was so before.
admin moved this to Done in Development on 2026-10-01 19:37:14 +02:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#288