diff options
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/PlatWin.cxx | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 22ee361ba..aa98918b8 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1567,12 +1567,16 @@ void SurfaceD2D::Copy(PRectangle rc, Point from, Surface &surfaceSource) {  	}  } -void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, UINT) { +void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, UINT fuOptions) {  	SetFont(font_);  	// Use Unicode calls  	const TextWide tbuf(s, len, unicodeMode, codePage);  	if (pRenderTarget && pTextFormat && pBrush) { +		if (fuOptions & ETO_CLIPPED) { +			D2D1_RECT_F rcClip = {rc.left, rc.top, rc.right, rc.bottom}; +			pRenderTarget->PushAxisAlignedClip(rcClip, D2D1_ANTIALIAS_MODE_ALIASED); +		}  		// Explicitly creating a text layout appears a little faster   		IDWriteTextLayout *pTextLayout; @@ -1583,6 +1587,10 @@ void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, co  			pRenderTarget->DrawTextLayout(origin, pTextLayout, pBrush, D2D1_DRAW_TEXT_OPTIONS_NONE);  			pTextLayout->Release();  		} + +		if (fuOptions & ETO_CLIPPED) { +			pRenderTarget->PopAxisAlignedClip(); +		}  	}  }  | 
