TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_pixel_snap.h File Reference
#include <gui_core/gui_base_types.h>
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  tachyon

Functions

int32_t tachyon::SnapPx (float v)
 Round half up, the same rule the box shader uses.
IntRect tachyon::SnapAbsolute (float4 px)
 A box with no snapped parent: each edge to the nearest pixel.
float4 tachyon::PixelBounds (const float3x2 &toPixels, IntRect r)
 The bounds of a rect mapped to window pixels, { x0, y0, x1, y1 }.
IntRect tachyon::SnapToParent (float4 parentPx, IntRect parentSnapped, float4 childPx)
 A nested box: each edge keeps its rounded distance from the parent's snapped edge on the same side.