// Aseprite UI Library // Copyright (C) 2020 Igara Studio S.A. // Copyright (C) 2017 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ui/style.h" #include "os/font.h" namespace ui { // static gfx::Border Style::UndefinedBorder() { return gfx::Border(-1, -1, -1, -1); } Style::Style(const Style* base) : m_insertionPoint(0) , m_margin(base ? base->margin(): Style::UndefinedBorder()) , m_border(base ? base->border(): Style::UndefinedBorder()) , m_padding(base ? base->padding(): Style::UndefinedBorder()) , m_font(nullptr) { if (base) m_layers = base->layers(); } void Style::setFont(const os::Ref& font) { m_font = font; } void Style::addLayer(const Layer& layer) { int i, j = int(m_layers.size()); for (i=m_insertionPoint; i