aboutsummaryrefslogtreecommitdiff
path: root/include/cru/osx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-10-31 22:53:11 +0800
committercrupest <crupest@outlook.com>2021-10-31 22:53:11 +0800
commit1dca2841da6f024f613d6dc16de456d5035f8fce (patch)
tree37ca6290afbe5900df2eb4a09e30024257d55316 /include/cru/osx
parente68e0d9a5130e8bc0b634572b7fd44b9bfc0f8ef (diff)
downloadcru-1dca2841da6f024f613d6dc16de456d5035f8fce.tar.gz
cru-1dca2841da6f024f613d6dc16de456d5035f8fce.tar.bz2
cru-1dca2841da6f024f613d6dc16de456d5035f8fce.zip
...
Diffstat (limited to 'include/cru/osx')
-rw-r--r--include/cru/osx/graphics/quartz/TextLayout.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/cru/osx/graphics/quartz/TextLayout.hpp b/include/cru/osx/graphics/quartz/TextLayout.hpp
index 95e3d1be..35bcc32d 100644
--- a/include/cru/osx/graphics/quartz/TextLayout.hpp
+++ b/include/cru/osx/graphics/quartz/TextLayout.hpp
@@ -30,19 +30,25 @@ class OsxCTTextLayout : public OsxQuartzResource, public virtual ITextLayout {
Rect GetTextBounds(bool includingTrailingSpace = false) override;
std::vector<Rect> TextRangeRect(const TextRange& text_range) override;
- Point TextSinglePoint(Index position, bool trailing) override;
+ Rect TextSinglePoint(Index position, bool trailing) override;
TextHitTestResult HitTest(const Point& point) override;
CTFrameRef GetCTFrameRef() const { return ct_frame_; }
CTFrameRef CreateFrameWithColor(const Color& color);
+ Matrix GetTransform() { return transform_; }
+
String GetDebugString() override;
private:
void ReleaseResource();
void RecreateFrame();
+ Rect DoGetTextBounds(bool includingTrailingSpace = false);
+ std::vector<Rect> DoTextRangeRect(const TextRange& text_range);
+ Rect DoTextSinglePoint(Index position, bool trailing);
+
private:
float max_width_;
float max_height_;
@@ -58,5 +64,7 @@ class OsxCTTextLayout : public OsxQuartzResource, public virtual ITextLayout {
int line_count_;
std::vector<CGPoint> line_origins_;
std::vector<CTLineRef> lines_;
+
+ Matrix transform_;
};
} // namespace cru::platform::graphics::osx::quartz