diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-07-19 22:30:46 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-07-20 22:11:00 +0200 |
commit | 213a13c52b5db9d1ebe9857857f9e7415cf97dce (patch) | |
tree | 91f91b8808db4be026a91e513817f0fdfea0d4c4 | |
parent | d9d16df299607d0fdbb7067ad1a8f7bccc85abf7 (diff) |
vcl quartz use the font size to approximate the position of the bullet
Change-Id: I00bf83c82814cd3d215bda361a14eb01836e2d0a
-rw-r--r-- | vcl/quartz/ctlayout.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index b8a063649833..9172f4de96b0 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -408,12 +408,15 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons CGFloat ascent; CGFloat descent; CGFloat leading; + CTFontRef runFont = (CTFontRef)CFDictionaryGetValue(CTRunGetAttributes(run), + kCTFontAttributeName); + CGFloat baseSize = CTFontGetSize(runFont); double fWidth = CTRunGetTypographicBounds ( run, glyphRange, &ascent, &descent, &leading); CTRunGetPositions(run, glyphRange, &position); CTRunGetAdvances(run, glyphRange, &advance); CGRect bulletRect = NSMakeRect(aTextPos.x + position.x + advance.width / 4, - aTextPos.y + position.y + ascent / 3 - fWidth / 2, fWidth / 2, fWidth / 2); + aTextPos.y + position.y + ascent / 3 - baseSize / 5, baseSize / 5, baseSize / 5 ); CGContextSaveGState(context); RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR CGContextSetFillColor( context, bulletColor.AsArray() ); |