diff options
author | crupest <crupest@outlook.com> | 2021-10-27 15:35:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-10-27 15:35:18 +0800 |
commit | 25454e67a12acfb0f7f85680fe8242f562002f70 (patch) | |
tree | cca15217d47ad9bbd513eca9f8ac506886243339 | |
parent | 395c5aa302518af0d9f66dfafc910b3eab88742d (diff) | |
download | cru-25454e67a12acfb0f7f85680fe8242f562002f70.tar.gz cru-25454e67a12acfb0f7f85680fe8242f562002f70.tar.bz2 cru-25454e67a12acfb0f7f85680fe8242f562002f70.zip |
...
-rw-r--r-- | src/osx/graphics/quartz/Painter.cpp | 2 | ||||
-rw-r--r-- | src/ui/render/BorderRenderObject.cpp | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/osx/graphics/quartz/Painter.cpp b/src/osx/graphics/quartz/Painter.cpp index ec951e6c..5657e048 100644 --- a/src/osx/graphics/quartz/Painter.cpp +++ b/src/osx/graphics/quartz/Painter.cpp @@ -141,7 +141,7 @@ void QuartzCGContextPainter::FillGeometry(IGeometry* geometry, IBrush* brush) { b->Select(cg_context_); CGContextBeginPath(cg_context_); CGContextAddPath(cg_context_, g->GetCGPath()); - CGContextFillPath(cg_context_); + CGContextEOFillPath(cg_context_); } void QuartzCGContextPainter::DrawText(const Point& offset, diff --git a/src/ui/render/BorderRenderObject.cpp b/src/ui/render/BorderRenderObject.cpp index 9e081828..9b886348 100644 --- a/src/ui/render/BorderRenderObject.cpp +++ b/src/ui/render/BorderRenderObject.cpp @@ -6,8 +6,8 @@ #include "cru/platform/graphics/Geometry.hpp" #include "cru/platform/graphics/util/Painter.hpp" #include "cru/ui/Base.hpp" +#include "cru/ui/DebugFlags.hpp" #include "cru/ui/style/ApplyBorderStyleInfo.hpp" -#include "gsl/gsl_assert" #include <algorithm> @@ -56,9 +56,19 @@ RenderObject* BorderRenderObject::HitTest(const Point& point) { } void BorderRenderObject::OnDrawCore(platform::graphics::IPainter* painter) { + if constexpr (debug_flags::draw) { + log::TagDebug( + log_tag, u"BorderRenderObject draw, background: {}, foreground: {}.", + background_brush_ == nullptr ? u"NONE" + : background_brush_->GetDebugString(), + foreground_brush_ == nullptr ? u"NONE" + : foreground_brush_->GetDebugString()); + } + if (background_brush_ != nullptr) painter->FillGeometry(border_inner_geometry_.get(), background_brush_.get()); + if (is_border_enabled_) { if (border_brush_ == nullptr) { log::TagWarn(log_tag, u"Border is enabled but border brush is null."); |