|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Geometry, hit-testing, and drawing for the toolbar Fill/Stroke widget. More...
#include <string>#include "donner/editor/EditorShellInternal.h"#include "donner/editor/ImGuiIncludes.h"Classes | |
| struct | donner::editor::internal::FillStrokeWidgetLayout |
| Screen-space rectangles for every drawable/interactive part of the widget. More... | |
| struct | donner::editor::internal::FillStrokeWidgetInteractionState |
| Stable interaction policy for one fill/stroke toolbar frame. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Enumerations | |
| enum class | donner::editor::internal::FillStrokeWidgetRegion { None , FillSwatch , StrokeSwatch , Swap , FillNone , StrokeNone , FillChip , StrokeChip } |
| Interactive regions of the Fill/Stroke widget, in hit-test priority order. More... | |
Functions | |
| FillStrokeWidgetInteractionState | donner::editor::internal::ResolveFillStrokeWidgetInteractionState (bool hasDocument, bool rendererBusy, bool canvasInteractionActive, bool paintSnapshotMatchesSelection) |
| Resolve editability and snapshot refresh without keying drag chrome to a renderer busy bit. | |
| FillStrokeWidgetLayout | donner::editor::internal::ComputeFillStrokeWidgetLayout (const ImVec2 &widgetMin, const ImVec2 &widgetMax) |
| Compute widget sub-rectangles from the widget's outer bounds. | |
| FillStrokeWidgetRegion | donner::editor::internal::HitTestFillStrokeWidget (const FillStrokeWidgetLayout &layout, const ImVec2 &point, bool fillIsCustom, bool strokeIsCustom) |
Classify point against layout. Chip regions only match when the corresponding slot carries custom paint (only then is a chip drawn). | |
| std::string | donner::editor::internal::SvgPaintStringForSlot (const ToolbarPaintSlotState &slot) |
| Reconstruct an SVG paint attribute string ("none", "#rrggbb", "url(#id)", "context-fill", ...) from a resolved paint slot. Used by the swap action. | |
| void | donner::editor::internal::SwapActivePaint (ActivePaintStyle &style) |
| Swap the fill and stroke of an active paint style in place. | |
| void | donner::editor::internal::DrawFillStrokeSwatch (ImDrawList *drawList, const ImVec2 &min, const ImVec2 &max, const ToolbarPaintSlotState &state, bool front) |
Draw a paint swatch. front draws a solid filled swatch (fill role); a non-front swatch draws a hollow ring (stroke role). Handles the none (red slash) and custom (diagonal hatch) presentations. | |
| void | donner::editor::internal::DrawSwapAffordance (ImDrawList *drawList, const ImVec2 &min, const ImVec2 &max, bool enabled) |
| Draw the swap double-arrow affordance. | |
| void | donner::editor::internal::DrawNoneAffordance (ImDrawList *drawList, const ImVec2 &min, const ImVec2 &max, bool fillVariant, bool active) |
Draw a "set none" affordance. fillVariant selects the solid (fill) motif versus the hollow (stroke) motif; active brightens it when the slot is already none. | |
Geometry, hit-testing, and drawing for the toolbar Fill/Stroke widget.
The widget presents the classic design-tool paired-swatch control: a filled "fill" swatch in front and a hollow "stroke" swatch behind, with per-slot affordances to clear a slot to none and to swap fill and stroke. The pure layout/hit-test/paint-string helpers here are unit tested; EditorShell owns the imgui interaction wiring and the color-picker popups.
|
strong |
Interactive regions of the Fill/Stroke widget, in hit-test priority order.
|
nodiscard |
Resolve editability and snapshot refresh without keying drag chrome to a renderer busy bit.
The caller reports whether its snapshot belongs to the current document and first selected element, not merely whether any snapshot exists.
| hasDocument | Whether the editor currently owns a document. |
| rendererBusy | Whether the async renderer currently owns document access. |
| canvasInteractionActive | Whether a canvas gesture is in progress. |
| paintSnapshotMatchesSelection | Whether the cached paint belongs to the current selection. |