summaryrefslogtreecommitdiffstats
path: root/generic/tkRectOval.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-10-25 21:06:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-10-25 21:06:25 (GMT)
commit0d5336db012f45753abace489f18f0ca299c6961 (patch)
treeb1bf3280a9046df99226158978502eeb26f5b0a3 /generic/tkRectOval.c
parente97381a6d921de403516d5b761539a450f4af83c (diff)
parent1320b8a2a9c1269a345d44d673a7a35707fbbe9c (diff)
downloadtk-core-tip-626.zip
tk-core-tip-626.tar.gz
tk-core-tip-626.tar.bz2
Merge 9.0core-tip-626
Diffstat (limited to 'generic/tkRectOval.c')
-rw-r--r--generic/tkRectOval.c188
1 files changed, 94 insertions, 94 deletions
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 2bbfce8..8f2e385 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -79,8 +79,8 @@ static const Tk_ConfigSpec configSpecs[] = {
NULL, offsetof(RectOvalItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
- "0", offsetof(RectOvalItem, outline.offset),
- TK_CONFIG_DONT_SET_DEFAULT, NULL},
+ "0", offsetof(RectOvalItem, outline.offsetObj),
+ TK_CONFIG_OBJS, NULL},
{TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
NULL, offsetof(RectOvalItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
@@ -765,101 +765,101 @@ DisplayRectOval(
&x2, &y2);
if (x2 == x1) {
- /*
- * The width of the bounding box corresponds to less than one pixel
- * on screen. Adjustment is needed to avoid drawing attempts with zero
- * width items (which would draw nothing). The bounding box spans
- * either 1 or 2 pixels. Select which pixel will be drawn.
- */
-
- short ix1 = (short) (rectOvalPtr->bbox[0]);
- short ix2 = (short) (rectOvalPtr->bbox[2]);
-
- if (ix1 == ix2) {
-
- /*
- * x1 and x2 are "within the same pixel". Use this pixel.
- * Note: the degenerated case (bbox[0]==bbox[2]) of a completely
- * flat box results in arbitrary selection of the pixel at the
- * right (with positive coordinate) or left (with negative
- * coordinate) of the box. There is no "best choice" here.
- */
-
- if (ix1 > 0) {
- x2 += 1;
- } else {
- x1 -= 1;
- }
- } else {
-
- /*
- * (x1,x2) span two pixels. Select the one with the larger
- * covered "area".
- */
-
- if (ix1 > 0) {
- if ((rectOvalPtr->bbox[2] - ix2) > (ix2 - rectOvalPtr->bbox[0])) {
- x2 += 1;
- } else {
- x1 -= 1;
- }
- } else {
- if ((rectOvalPtr->bbox[2] - ix1) > (ix1 - rectOvalPtr->bbox[0])) {
- x2 += 1;
- } else {
- x1 -= 1;
- }
- }
- }
+ /*
+ * The width of the bounding box corresponds to less than one pixel
+ * on screen. Adjustment is needed to avoid drawing attempts with zero
+ * width items (which would draw nothing). The bounding box spans
+ * either 1 or 2 pixels. Select which pixel will be drawn.
+ */
+
+ short ix1 = (short) (rectOvalPtr->bbox[0]);
+ short ix2 = (short) (rectOvalPtr->bbox[2]);
+
+ if (ix1 == ix2) {
+
+ /*
+ * x1 and x2 are "within the same pixel". Use this pixel.
+ * Note: the degenerated case (bbox[0]==bbox[2]) of a completely
+ * flat box results in arbitrary selection of the pixel at the
+ * right (with positive coordinate) or left (with negative
+ * coordinate) of the box. There is no "best choice" here.
+ */
+
+ if (ix1 > 0) {
+ x2 += 1;
+ } else {
+ x1 -= 1;
+ }
+ } else {
+
+ /*
+ * (x1,x2) span two pixels. Select the one with the larger
+ * covered "area".
+ */
+
+ if (ix1 > 0) {
+ if ((rectOvalPtr->bbox[2] - ix2) > (ix2 - rectOvalPtr->bbox[0])) {
+ x2 += 1;
+ } else {
+ x1 -= 1;
+ }
+ } else {
+ if ((rectOvalPtr->bbox[2] - ix1) > (ix1 - rectOvalPtr->bbox[0])) {
+ x2 += 1;
+ } else {
+ x1 -= 1;
+ }
+ }
+ }
}
if (y2 == y1) {
- /*
- * The height of the bounding box corresponds to less than one pixel
- * on screen. Adjustment is needed to avoid drawing attempts with zero
- * height items (which would draw nothing). The bounding box spans
- * either 1 or 2 pixels. Select which pixel will be drawn.
- */
-
- short iy1 = (short) (rectOvalPtr->bbox[1]);
- short iy2 = (short) (rectOvalPtr->bbox[3]);
-
- if (iy1 == iy2) {
-
- /*
- * y1 and y2 are "within the same pixel". Use this pixel.
- * Note: the degenerated case (bbox[1]==bbox[3]) of a completely
- * flat box results in arbitrary selection of the pixel below
- * (with positive coordinate) or above (with negative coordinate)
- * the box. There is no "best choice" here.
- */
-
- if (iy1 > 0) {
- y2 += 1;
- } else {
- y1 -= 1;
- }
- } else {
-
- /*
- * (y1,y2) span two pixels. Select the one with the larger
- * covered "area".
- */
-
- if (iy1 > 0) {
- if ((rectOvalPtr->bbox[3] - iy2) > (iy2 - rectOvalPtr->bbox[1])) {
- y2 += 1;
- } else {
- y1 -= 1;
- }
- } else {
- if ((rectOvalPtr->bbox[3] - iy1) > (iy1 - rectOvalPtr->bbox[1])) {
- y2 += 1;
- } else {
- y1 -= 1;
- }
- }
- }
+ /*
+ * The height of the bounding box corresponds to less than one pixel
+ * on screen. Adjustment is needed to avoid drawing attempts with zero
+ * height items (which would draw nothing). The bounding box spans
+ * either 1 or 2 pixels. Select which pixel will be drawn.
+ */
+
+ short iy1 = (short) (rectOvalPtr->bbox[1]);
+ short iy2 = (short) (rectOvalPtr->bbox[3]);
+
+ if (iy1 == iy2) {
+
+ /*
+ * y1 and y2 are "within the same pixel". Use this pixel.
+ * Note: the degenerated case (bbox[1]==bbox[3]) of a completely
+ * flat box results in arbitrary selection of the pixel below
+ * (with positive coordinate) or above (with negative coordinate)
+ * the box. There is no "best choice" here.
+ */
+
+ if (iy1 > 0) {
+ y2 += 1;
+ } else {
+ y1 -= 1;
+ }
+ } else {
+
+ /*
+ * (y1,y2) span two pixels. Select the one with the larger
+ * covered "area".
+ */
+
+ if (iy1 > 0) {
+ if ((rectOvalPtr->bbox[3] - iy2) > (iy2 - rectOvalPtr->bbox[1])) {
+ y2 += 1;
+ } else {
+ y1 -= 1;
+ }
+ } else {
+ if ((rectOvalPtr->bbox[3] - iy1) > (iy1 - rectOvalPtr->bbox[1])) {
+ y2 += 1;
+ } else {
+ y1 -= 1;
+ }
+ }
+ }
}
/*