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 , SetNone , 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 authoringSuspended, bool paintSnapshotMatchesSelection) |
| Resolve safe paint mutation and snapshot refresh. | |
| 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, bool fillIsActive) |
Classify point against layout. The active swatch wins overlap. Chip regions only match when the corresponding slot carries custom paint. | |
| 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 fillRole, bool active) |
Draw a paint swatch. fillRole determines the solid Fill versus hollow Stroke motif, independently of active foreground status. 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 alreadyNone) |
Draw the single "set none" affordance; alreadyNone brightens it when the active role is already none. | |
| void | donner::editor::internal::DrawFillStrokeWidget (ImDrawList *drawList, const FillStrokeWidgetLayout &layout, const ToolbarPaintState &paintState, bool fillIsActive, bool canEdit) |
| Draw both fixed paint roles in foreground order with their shared controls and optional custom-paint chips. | |
Geometry, hit-testing, and drawing for the toolbar Fill/Stroke widget.
The widget presents the classic design-tool paired-swatch control: a solid Fill swatch at upper left and a hollow Stroke swatch at lower right. The active role comes to the foreground; one None control clears it. 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 safe paint mutation and snapshot refresh.
Renderer availability must not drive chrome tint.
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. |
| authoringSuspended | Whether a canvas gesture or Preview suspends authoring. |
| paintSnapshotMatchesSelection | Whether the cached paint belongs to the current selection. |