[haiku-webkit-commits] r320 - webkit/trunk/WebCore/platform/graphics/haiku

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Mar 2010 12:25:16 +0000

Author: stippi
Date: Wed Mar 17 12:25:15 2010
New Revision: 320
URL: http://mmlr.dyndns.org/changeset/320

Log:
Make the arc routine, which is currently optimized for drawing round corners
of box elements correctly without supporting clipping paths, work better with
various stroke widths. Testpage:
<http://samples.msdn.microsoft.com/ietestcenter/css3/bordersbackgrounds/border-radius-different-width-001.htm>

Modified:
   webkit/trunk/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp

Modified: webkit/trunk/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
==============================================================================
--- webkit/trunk/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp       
Tue Mar 16 21:09:54 2010        (r319)
+++ webkit/trunk/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp       
Wed Mar 17 12:25:15 2010        (r320)
@@ -409,23 +409,22 @@
     m_data->view()->SetPenSize(penSize);
     BRect bRect(rect.x(), rect.y(), rect.right(), rect.bottom());
     if (startAngle >= 0 && startAngle < 90) {
-        bRect.right -= penSize;
-        bRect.top += penSize / 2.0f;
-        bRect.bottom -= penSize / 2.0f;
+        bRect.right -= penSize / 2 + 0.5;
+        bRect.top += penSize / 2 - 0.5;
+        bRect.bottom -= penSize / 2 - 0.5;
     } else if (startAngle >= 90 && startAngle < 180) {
-        bRect.left += penSize / 2.0f;
-        bRect.top += penSize / 2.0f;
-        bRect.right -= penSize / 2.0f;
-        bRect.bottom -= penSize / 2.0f;
+        bRect.left += penSize / 2 - 0.5;
+        bRect.top += penSize / 2 - 0.5;
+        bRect.right -= penSize / 2 - 0.5;
+        bRect.bottom -= penSize / 2 - 0.5;
     } else if (startAngle >= 180 && startAngle < 270) {
-        bRect.left += penSize / 2.0f;
-        bRect.right -= penSize / 2.0f;
-        bRect.bottom -= penSize;
+        bRect.left += penSize / 2 - 0.5;
+        bRect.right -= penSize / 2 - 0.5;
+        bRect.bottom -= penSize / 2 + 0.5;
     } else if (startAngle >= 270 && startAngle < 360) {
-        bRect.right -= penSize;
-        bRect.bottom -= penSize;
+        bRect.right -= penSize / 2 + 0.5;
+        bRect.bottom -= penSize / 2 + 0.5;
     }
-    bRect.OffsetTo(floorf(bRect.left), floorf(bRect.top));
     uint32 flags = m_data->view()->Flags();
     m_data->view()->SetFlags(flags | B_SUBPIXEL_PRECISE);
     m_data->view()->StrokeArc(bRect, startAngle, angleSpan, 
getHaikuStrokeStyle());

Other related posts:

  • » [haiku-webkit-commits] r320 - webkit/trunk/WebCore/platform/graphics/haiku - webkit