diff --git a/fontConverter/src/main.cpp b/fontConverter/src/main.cpp index f4d24b7..c1da7c5 100644 --- a/fontConverter/src/main.cpp +++ b/fontConverter/src/main.cpp @@ -26,7 +26,7 @@ int main() export_font["sizes"] = json::object(); std::vector sizes = - {12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 100, 250}; + {12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 35, 40, 100, 250}; for(auto& size : sizes) { diff --git a/frame/src/widgets/ContainerWidget.cpp b/frame/src/widgets/ContainerWidget.cpp index cb20f2d..0053b5c 100644 --- a/frame/src/widgets/ContainerWidget.cpp +++ b/frame/src/widgets/ContainerWidget.cpp @@ -17,6 +17,7 @@ namespace frame::widgets void ContainerWidget::setSlot(size_t slot, Widget::shared_ptr ptr) { + ptr->setParent(this); widgets[slot] = ptr; } diff --git a/frame/src/widgets/Widget.cpp b/frame/src/widgets/Widget.cpp index b6f7357..4a63183 100644 --- a/frame/src/widgets/Widget.cpp +++ b/frame/src/widgets/Widget.cpp @@ -3,7 +3,7 @@ namespace frame::widgets { - Widget::shared_ptr Widget::getParent() const + Widget::week_ptr Widget::getParent() const { return mParent; } diff --git a/frame/src/widgets/Widget.hpp b/frame/src/widgets/Widget.hpp index 1bea7f1..4441a47 100644 --- a/frame/src/widgets/Widget.hpp +++ b/frame/src/widgets/Widget.hpp @@ -11,7 +11,7 @@ namespace frame::widgets { public: using shared_ptr = std::shared_ptr; - using week_ptr = std::shared_ptr; + using week_ptr = Widget*; public: virtual ~Widget() = default; @@ -20,7 +20,7 @@ namespace frame::widgets virtual void Render(render::RenderTarget& rt) = 0; virtual void ComputeChildSize(Vector size){}; - shared_ptr getParent() const; + week_ptr getParent() const; void setParent(week_ptr ptr); void setSize(Vector size); @@ -34,8 +34,8 @@ namespace frame::widgets void setClear(); private: - week_ptr mParent; - bool mDirty = true; + week_ptr mParent = nullptr; + bool mDirty = true; Vector mRelativePosition; Vector mSize; diff --git a/frame/src/widgets/clock/Analog.cpp b/frame/src/widgets/clock/Analog.cpp index 45e0086..187791a 100644 --- a/frame/src/widgets/clock/Analog.cpp +++ b/frame/src/widgets/clock/Analog.cpp @@ -127,8 +127,6 @@ namespace frame::widgets // Top - rt.setInvert(true); - auto top = getSlot(0); if(top) { @@ -147,8 +145,6 @@ namespace frame::widgets rt.popViewport(); } - rt.setInvert(false); - // Text /*auto font = font::GetFont("Fira Code"); diff --git a/frame/src/widgets/clock/Date.cpp b/frame/src/widgets/clock/Date.cpp index 693c645..a80d871 100644 --- a/frame/src/widgets/clock/Date.cpp +++ b/frame/src/widgets/clock/Date.cpp @@ -41,12 +41,14 @@ namespace frame::widgets auto font_size = font->getOptimalSize(text, draw); + rt.setInvert(true); rt.DrawText(draw, text, *font, font_size, AlignHorizontal::CENTER, AlignVertical::CENTER); + rt.setInvert(false); setClear(); } diff --git a/frame/src/widgets/clock/Digital.cpp b/frame/src/widgets/clock/Digital.cpp index c88ec48..0ff5014 100644 --- a/frame/src/widgets/clock/Digital.cpp +++ b/frame/src/widgets/clock/Digital.cpp @@ -43,12 +43,14 @@ namespace frame::widgets auto font_size = font->getOptimalSize(text, draw); + rt.setInvert(true); rt.DrawText(draw, text, *font, font_size, AlignHorizontal::CENTER, AlignVertical::CENTER); + rt.setInvert(false); setClear(); }