Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
CanvasScrollbars.h File Reference

Geometry for the render pane's emulated canvas scrollbars. The canvas pane never window-scrolls (an ImGui window scrollbar would move the in-pane overlay chrome - toolbar, perf HUD - instead of the document), so the pane draws its own scrollbars that represent the document extent relative to the viewport and pan the canvas when dragged. More...

Include dependency graph for CanvasScrollbars.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::CanvasScrollbarAxis
 One scrollbar axis of the render pane's emulated canvas scrollbars. More...
struct  donner::editor::CanvasScrollbars
 Both axes of the render pane's emulated canvas scrollbars. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

bool donner::editor::CanvasScrollbarsContain (const ViewportState &viewport, const Vector2d &screenPoint)
 True when screenPoint lies on a visible scrollbar rail for viewport. Canvas tools must ignore pointer input over the rails so scrollbar drags never become canvas clicks or element drags.
CanvasScrollbars donner::editor::ComputeCanvasScrollbars (const ViewportState &viewport)
 Compute the emulated scrollbar geometry for viewport. The scrollable content extent on each axis is the union of the document's screen-space box and the pane, matching the usual scroll-region contract (scrolling can always bring the viewport back to the document).

Variables

constexpr double donner::editor::kCanvasScrollbarMinThumbPx = 24.0
 Minimum thumb length in logical pixels so the thumb stays grabbable at extreme zoom.
constexpr double donner::editor::kCanvasScrollbarRailPx = 10.0
 Rail thickness in logical pixels (drawn along the pane bottom/right edges).

Detailed Description

Geometry for the render pane's emulated canvas scrollbars. The canvas pane never window-scrolls (an ImGui window scrollbar would move the in-pane overlay chrome - toolbar, perf HUD - instead of the document), so the pane draws its own scrollbars that represent the document extent relative to the viewport and pan the canvas when dragged.