Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
ViewportGeometry.h File Reference
#include <optional>
#include "donner/base/Box.h"
#include "donner/base/Vector2.h"
Include dependency graph for ViewportGeometry.h:

Classes

struct  donner::editor::DrawingViewportLayout
 Computed layout for the Drawing window image, plus helpers for converting between screen coordinates and document coordinates. More...

Namespaces

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

Functions

DrawingViewportLayout donner::editor::ComputeDrawingViewportLayout (const Vector2d &contentOrigin, const Vector2d &availableRegionSize, const Vector2d &imageSize, const Vector2d &panOffset, const Box2d &documentViewBox)
 Computes the visible image placement in the Drawing window.

Function Documentation

◆ ComputeDrawingViewportLayout()

DrawingViewportLayout donner::editor::ComputeDrawingViewportLayout ( const Vector2d & contentOrigin,
const Vector2d & availableRegionSize,
const Vector2d & imageSize,
const Vector2d & panOffset,
const Box2d & documentViewBox )
nodiscard

Computes the visible image placement in the Drawing window.

Parameters
contentOriginTop-left screen position of the available drawing area.
availableRegionSizeSize of the available drawing area in screen coordinates.
imageSizeRendered image size in screen coordinates.
panOffsetPan offset in screen coordinates.
documentViewBoxVisible document-space viewBox.
Returns
Layout and coordinate-mapping helpers for the viewport.