Forward port of my recent changes in the 2.8 branch:
* Force use of floating point math in wxGCDC::DoDrawEllipticArc. * Check for 0.5 offset in wxGCDC::DoDrawRoundedRectangle and DoDrawEllipse. Set wxGDIPlusContext to use the offset. * Avoid crash in wxStdDialogButtonSizer::Realize if there is no negative button. * Provide implementations for wxCairoPathData::AddPath, wxCairoContext::Clip, wxCairoContext::DrawBitmap, wxCairoContext::DrawIcon, and wxCairoContext::GetTextExtent. * Fix wxCairoContext::DrawText to draw the text using the upper-left corner for the x,y position, not the baseline. * Fix wxMacCoreGraphicsRenderer::CreateContext to be able to use a wxMemoryDC as the target. * Map wxTELETYPE font family on wxMac to a monospace font. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -303,6 +303,7 @@ public:
|
||||
virtual void GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height,
|
||||
wxDouble *descent, wxDouble *externalLeading ) const;
|
||||
virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const;
|
||||
virtual bool ShouldOffset() const;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
@@ -1185,6 +1186,18 @@ void wxGDIPlusContext::GetPartialTextExtents(const wxString& text, wxArrayDouble
|
||||
}
|
||||
}
|
||||
|
||||
bool wxGDIPlusContext::ShouldOffset() const
|
||||
{
|
||||
int penwidth = 0 ;
|
||||
if ( !m_pen.IsNull() )
|
||||
{
|
||||
penwidth = (int)((wxGDIPlusPenData*)m_pen.GetRefData())->GetWidth();
|
||||
if ( penwidth == 0 )
|
||||
penwidth = 1;
|
||||
}
|
||||
return ( penwidth % 2 ) == 1;
|
||||
}
|
||||
|
||||
void* wxGDIPlusContext::GetNativeContext()
|
||||
{
|
||||
return m_context;
|
||||
|
Reference in New Issue
Block a user