17 offset_(
alignment.resolveOffset(extents_, anchorExtents)),
18 interior_(
Box::Intersect(
interior.translate(offset_.dx, offset_.dy),
50 background_ =
nullptr;
54 bgcolor_ = color::Background;
91 interior_(interior) {}
94 TileBase::draw(
s, *interior_);
104template <
typename DrawableType>
111 interior_(std::
move(interior)) {}
120template <
typename DrawableType>
Combines horizontal and vertical alignment.
Axis-aligned integer rectangle.
ARGB8888 color stored as a 32-bit unsigned integer.
Interface for objects that can be drawn to an output device.
virtual Box anchorExtents() const
Return the bounds used for alignment.
Drawable that can provide a color for any point within its extents.
Low-level handle used to draw to an underlying device.
Tile with embedded interior object.
TileOf(DrawableType interior, Box extents, Alignment alignment, Color bgcolor=color::Background)
Create a tile with embedded interior and alignment.
void drawTo(const Surface &s) const override
Draw this object's content, respecting the fill mode.
Rectangular drawable with background and aligned interior.
Tile(const Drawable *interior, Box extents, Alignment alignment, Color bgcolor=color::Background)
Create a tile with the specified interior, extents, and alignment.
void drawTo(const Surface &s) const override
Draw this object's content, respecting the fill mode.
const Box & interior() const
SolidBorder(Box extents, Box interior, Box anchorExtents, Alignment alignment)
const Box & extents() const
void setBgColor(Color bgcolor)
void setBackground(const Rasterizable *background)
TileBase(const Drawable &interior, Box extents, Alignment alignment, Color bgcolor=color::Background)
void draw(const Surface &s, const Drawable &interior) const
void drawInternal(const Surface &s, const Drawable &interior) const
Box extents() const override
Return the bounding box encompassing all pixels that need to be drawn.
Defines 140 opaque HTML named colors.
TileOf< DrawableType > MakeTileOf(DrawableType interior, Box extents, Alignment alignment=kNoAlign, Color bgcolor=color::Background)
Convenience factory for a TileOf.
static constexpr Alignment kNoAlign
Absolute alignment (no repositioning).