| ... |
... |
@@ -1254,45 +1254,6 @@ void wxDC::DrawLabel(const wxString& text, |
|
1254
|
1254
|
m_pimpl->CalcBoundingBox(wxPoint(x0, y0), wxSize(width0, height));
|
|
1255
|
1255
|
}
|
|
1256
|
1256
|
|
|
1257
|
|
-/*
|
|
1258
|
|
-Notes for wxWidgets DrawEllipticArcRot(...)
|
|
1259
|
|
-
|
|
1260
|
|
-wxDCBase::DrawEllipticArcRot(...) draws a rotated elliptic arc or an ellipse.
|
|
1261
|
|
-It uses wxDCBase::CalculateEllipticPoints(...) and wxDCBase::Rotate(...),
|
|
1262
|
|
-which are also new.
|
|
1263
|
|
-
|
|
1264
|
|
-All methods are generic, so they can be implemented in wxDCBase.
|
|
1265
|
|
-
|
|
1266
|
|
-CalculateEllipticPoints(...) fills a given list of wxPoints with some points
|
|
1267
|
|
-of an elliptic arc. The algorithm is pixel-based: In every row (in flat
|
|
1268
|
|
-parts) or every column (in steep parts) only one pixel is calculated.
|
|
1269
|
|
-Trigonometric calculation (sin, cos, tan, atan) is only done if the
|
|
1270
|
|
-starting angle is not equal to the ending angle. The calculation of the
|
|
1271
|
|
-pixels is done using simple arithmetic only and should perform not too
|
|
1272
|
|
-bad even on devices without floating point processor. I didn't test this yet.
|
|
1273
|
|
-
|
|
1274
|
|
-Rotate(...) rotates a list of point pixel-based, you will see rounding errors.
|
|
1275
|
|
-For instance: an ellipse rotated 180 degrees is drawn
|
|
1276
|
|
-slightly different from the original.
|
|
1277
|
|
-
|
|
1278
|
|
-The points are then moved to an array and used to draw a polyline and/or polygon
|
|
1279
|
|
-(with center added, the pie).
|
|
1280
|
|
-The result looks quite similar to the native ellipse, only e few pixels differ.
|
|
1281
|
|
-
|
|
1282
|
|
-The performance on a desktop system (Athlon 1800, WinXP) is about 7 times
|
|
1283
|
|
-slower as DrawEllipse(...), which calls the native API.
|
|
1284
|
|
-An rotated ellipse outside the clipping region takes nearly the same time,
|
|
1285
|
|
-while an native ellipse outside takes nearly no time to draw.
|
|
1286
|
|
-
|
|
1287
|
|
-If you draw an arc with this new method, you will see the starting and ending angles
|
|
1288
|
|
-are calculated properly.
|
|
1289
|
|
-If you use DrawEllipticArc(...), you will see they are only correct for circles
|
|
1290
|
|
-and not properly calculated for ellipses.
|
|
1291
|
|
-
|
|
1292
|
|
-Peter Lenhard
|
|
1293
|
|
-p.le...@t-online.de
|
|
1294
|
|
-*/
|
|
1295
|
|
-
|
|
1296
|
1257
|
float wxDCImpl::GetFontPointSizeAdjustment(float dpi)
|
|
1297
|
1258
|
{
|
|
1298
|
1259
|
// wxMSW has long-standing bug where wxFont point size is interpreted as
|