diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-03 13:01:34 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-08-03 13:01:34 +0000 |
commit | 77d5f8f6cc9cfd43888366ff63c6ddcc43e5da0e (patch) | |
tree | 4314e5a28bb04222fcfa25aaae9c6b27175fa071 /vcl/aqua/source/gdi/salatslayout.cxx | |
parent | cfd6238db11c324d75af90a36b24e26f2db9e805 (diff) |
INTEGRATION: CWS aquavcl02 (1.1.4); FILE MERGED
2007/07/19 14:01:43 ekato 1.1.4.5: #i79737# fix incorrect spacing with punctuations
2007/07/12 19:47:11 pl 1.1.4.4: #i79300# better refresh rectangles
2007/07/11 11:17:34 pjanik 1.1.4.3: #i10000#: Adapt VCL header paths.
2007/07/02 11:53:46 pl 1.1.4.2: join from aquavcl01
2006/07/28 18:49:40 pl 1.1.4.1: file salatslayout.cxx was added on branch cws_src680_aquavcl02 on 2007-07-02 11:53:46 +0000
Diffstat (limited to 'vcl/aqua/source/gdi/salatslayout.cxx')
-rwxr-xr-x | vcl/aqua/source/gdi/salatslayout.cxx | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx index e1b23e308cb7..d8a0957f8027 100755 --- a/vcl/aqua/source/gdi/salatslayout.cxx +++ b/vcl/aqua/source/gdi/salatslayout.cxx @@ -4,9 +4,9 @@ * * $RCSfile: salatslayout.cxx,v $ * -* $Revision: 1.3 $ +* $Revision: 1.4 $ * -* last change: $Author: rt $ $Date: 2007-07-05 15:58:25 $ +* last change: $Author: hr $ $Date: 2007-08-03 14:01:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -241,20 +241,26 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs ) if( !nPixelWidth ) return; - ATSUAttributeTag nTags[2]; - ATSUAttributeValuePtr nVals[2]; - ByteCount nBytes[2]; + ATSUAttributeTag nTags[3]; + ATSUAttributeValuePtr nVals[3]; + ByteCount nBytes[3]; Fixed nFixedWidth = FloatToFixed( nPixelWidth / mfFontScale ); mnCachedWidth = nFixedWidth; Fract nFractFactor = kATSUFullJustification; + ATSLineLayoutOptions nLineLayoutOptions = kATSLineHasNoHangers; + nTags[0] = kATSULineWidthTag; nVals[0] = &nFixedWidth; nBytes[0] = sizeof(Fixed); - nTags[1] = kATSULineJustificationFactorTag; - nVals[1] = &nFractFactor; - nBytes[1] = sizeof(Fract); - OSStatus eStatus = ATSUSetLayoutControls( maATSULayout, 2, nTags, nBytes, nVals ); + nTags[1] = kATSULineLayoutOptionsTag; + nVals[1] = &nLineLayoutOptions; + nBytes[1] = sizeof(ATSLineLayoutOptions); + nTags[2] = kATSULineJustificationFactorTag; + nVals[2] = &nFractFactor; + nBytes[2] = sizeof(Fract); + + OSStatus eStatus = ATSUSetLayoutControls( maATSULayout, 3, nTags, nBytes, nVals ); if( eStatus != noErr ) return; } @@ -322,9 +328,18 @@ void ATSLayout::DrawText( SalGraphics& rGraphics ) const theErr = ATSUMeasureTextImage( maATSULayout, mnMinCharPos, mnCharCount, nFixedX, nFixedY, &drawRect ); if( theErr == noErr ) - mpGraphics->RefreshRect( drawRect.left, drawRect.bottom, - drawRect.right - drawRect.left, - drawRect.bottom - drawRect.top ); + { + // FIXME: transformation from baseline to top left + // with the simple apporach below we invalidate too much + short d = drawRect.bottom - drawRect.top; + drawRect.top -= d; + drawRect.bottom += d; + CGRect aRect = CGRectMake( drawRect.left, drawRect.top, + drawRect.right - drawRect.left, + drawRect.bottom - drawRect.top ); + aRect = CGContextConvertRectToDeviceSpace( mpGraphics->mrContext, aRect ); + mpGraphics->RefreshRect( aRect.origin.x, aRect.origin.y, aRect.size.width+1, aRect.size.height+1 ); + } } // restore the original graphic context transformations |