DVUI

drawBackground

Parameters

#
self:*ButtonWidget
*ButtonWidget

Source

Implementation

#
pub fn drawBackground(self: *ButtonWidget) void {
    const style_opt = self.style();
    var npask: Options.NinepatchAsk = .fill;
    if (dvui.captured(self.data().id)) {
        npask = .press;
    } else if (self.hover) {
        npask = .hover;
    }
    self.data().borderAndBackground(.{
        .fill_color = style_opt.color_fill,
        .ninepatch = self.data().options.ninepatch(npask),
    });
}