#if 0 the bounding box drawn around all text (which was for testing)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21748
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
+ NSGraphicsContext *context = [NSGraphicsContext currentContext];
+ [context saveGraphicsState];
+
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,width,height)];
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,width,height)];
+ [m_textForegroundColour.GetNSColor() set];
+ [m_brush.GetNSColor() set];
+ [bezpath fill];
+
+ [context restoreGraphicsState];
}
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
}
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
+ NSGraphicsContext *context = [NSGraphicsContext currentContext];
+ [context saveGraphicsState];
+
NSBezierPath *bezpath = [NSBezierPath bezierPath];
[bezpath moveToPoint:NSMakePoint(x1,y1)];
[bezpath lineToPoint:NSMakePoint(x2,y2)];
NSBezierPath *bezpath = [NSBezierPath bezierPath];
[bezpath moveToPoint:NSMakePoint(x1,y1)];
[bezpath lineToPoint:NSMakePoint(x2,y2)];
+
+ [m_textForegroundColour.GetNSColor() set];
+
+ [context restoreGraphicsState];
}
void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord *descent, wxCoord *externalLeading, wxFont *theFont) const
}
void wxDC::DoGetTextExtent(const wxString& text, wxCoord *x, wxCoord *y, wxCoord *descent, wxCoord *externalLeading, wxFont *theFont) const
[context saveGraphicsState];
[transform concat];
[flipTransform concat];
[context saveGraphicsState];
[transform concat];
[flipTransform concat];
// Draw+fill a rectangle so we can see where the shit is supposed to be.
wxLogDebug("(%f,%f) (%fx%f)",usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height);
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)];
// Draw+fill a rectangle so we can see where the shit is supposed to be.
wxLogDebug("(%f,%f) (%fx%f)",usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height);
NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)];
[bezpath stroke];
[[NSColor blueColor] set];
[bezpath fill];
[bezpath stroke];
[[NSColor blueColor] set];
[bezpath fill];
NSPoint layoutLocation = [sm_cocoaNSLayoutManager locationForGlyphAtIndex:0];
layoutLocation.x = 0.0;
layoutLocation.y *= -1.0;
layoutLocation.y += [[sm_cocoaNSLayoutManager typesetter] baselineOffsetInLayoutManager:sm_cocoaNSLayoutManager glyphIndex:0];
// NOTE: That's NSMakePoint, not NSMakePint (working on that though)
NSPoint layoutLocation = [sm_cocoaNSLayoutManager locationForGlyphAtIndex:0];
layoutLocation.x = 0.0;
layoutLocation.y *= -1.0;
layoutLocation.y += [[sm_cocoaNSLayoutManager typesetter] baselineOffsetInLayoutManager:sm_cocoaNSLayoutManager glyphIndex:0];
// NOTE: That's NSMakePoint, not NSMakePint (working on that though)
+ [m_textForegroundColour.GetNSColor() set];
[sm_cocoaNSLayoutManager drawGlyphsForGlyphRange:glyphRange atPoint:layoutLocation];
[context restoreGraphicsState];
[sm_cocoaNSLayoutManager drawGlyphsForGlyphRange:glyphRange atPoint:layoutLocation];
[context restoreGraphicsState];
void wxDC::SetBrush(const wxBrush& brush)
{
void wxDC::SetBrush(const wxBrush& brush)
{
}
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
}
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)