diff options
author | crupest <crupest@outlook.com> | 2021-10-20 17:04:27 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-10-20 17:04:27 +0800 |
commit | 152133978872f6d6476c3fc7e0e3a5a6cc23b119 (patch) | |
tree | 374a793cb56ef5c8d1e413f4b781fec087e28678 /include | |
parent | 398aadcddb8b6ed20b17f6c56cd7b49947b72136 (diff) | |
download | cru-152133978872f6d6476c3fc7e0e3a5a6cc23b119.tar.gz cru-152133978872f6d6476c3fc7e0e3a5a6cc23b119.tar.bz2 cru-152133978872f6d6476c3fc7e0e3a5a6cc23b119.zip |
...
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/osx/graphics/quartz/Painter.hpp | 2 | ||||
-rw-r--r-- | include/cru/osx/graphics/quartz/TextLayout.hpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/cru/osx/graphics/quartz/Painter.hpp b/include/cru/osx/graphics/quartz/Painter.hpp index ea64c3d5..60a660a0 100644 --- a/include/cru/osx/graphics/quartz/Painter.hpp +++ b/include/cru/osx/graphics/quartz/Painter.hpp @@ -62,5 +62,7 @@ class QuartzCGContextPainter : public OsxQuartzResource, Size size_; std::function<void(QuartzCGContextPainter*)> on_end_draw_; + + std::vector<Rect> clip_stack_; }; } // namespace cru::platform::graphics::osx::quartz diff --git a/include/cru/osx/graphics/quartz/TextLayout.hpp b/include/cru/osx/graphics/quartz/TextLayout.hpp index dd170142..92e0c861 100644 --- a/include/cru/osx/graphics/quartz/TextLayout.hpp +++ b/include/cru/osx/graphics/quartz/TextLayout.hpp @@ -35,7 +35,10 @@ class OsxCTTextLayout : public OsxQuartzResource, public virtual ITextLayout { CTFrameRef GetCTFrameRef() const { return ct_frame_; } + CTFrameRef CreateFrameWithColor(const Color& color); + private: + void ReleaseResource(); void RecreateFrame(); private: @@ -45,10 +48,10 @@ class OsxCTTextLayout : public OsxQuartzResource, public virtual ITextLayout { std::shared_ptr<OsxCTFont> font_; String text_; - CFStringRef cf_text_; + CFAttributedStringRef cf_attributed_text_; - CTFramesetterRef ct_framesetter_; - CTFrameRef ct_frame_; + CTFramesetterRef ct_framesetter_ = nullptr; + CTFrameRef ct_frame_ = nullptr; int line_count_; std::vector<CGPoint> line_origins_; std::vector<CTLineRef> lines_; |