ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ImageContainer.hpp File Reference

A node that draws a single texture into its rect with optional cropping and fit modes. More...

#include "Common.hpp"
#include "Layout.hpp"
#include <algorithm>
#include <optional>
#include <string_view>
#include <utility>

Go to the source code of this file.

Classes

class  ZenitUI::UI::ImageContainer
 A single-texture node supporting sub-rect cropping (sourceRect) and ObjectFit. More...

Enumerations

enum class  ZenitUI::UI::ObjectFit {
  ObjectFit::Fill , ObjectFit::Contain , ObjectFit::Cover , ObjectFit::None ,
  ObjectFit::ScaleDown
}
 How ImageContainer fits the source texture into its layout rect. More...

Detailed Description

A node that draws a single texture into its rect with optional cropping and fit modes.

Uses the style's tint colour to modulate the texture alpha; the renderer receives the resulting colour. The intrinsic size is zero — the caller must set an explicit size or wrap the container in a layout that does.