< prev index next >
src/java.desktop/share/classes/java/awt/geom/RoundRectIterator.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 88,98 ****
// For each array:
// 4 values for each point {v0, v1, v2, v3}:
// point = (x + v0 * w + v1 * arcWidth,
// y + v2 * h + v3 * arcHeight);
! private static double ctrlpts[][] = {
{ 0.0, 0.0, 0.0, 0.5 },
{ 0.0, 0.0, 1.0, -0.5 },
{ 0.0, 0.0, 1.0, -acv,
0.0, acv, 1.0, 0.0,
0.0, 0.5, 1.0, 0.0 },
--- 88,98 ----
// For each array:
// 4 values for each point {v0, v1, v2, v3}:
// point = (x + v0 * w + v1 * arcWidth,
// y + v2 * h + v3 * arcHeight);
! private static double[][] ctrlpts = {
{ 0.0, 0.0, 0.0, 0.5 },
{ 0.0, 0.0, 1.0, -0.5 },
{ 0.0, 0.0, 1.0, -acv,
0.0, acv, 1.0, 0.0,
0.0, 0.5, 1.0, 0.0 },
*** 108,118 ****
{ 0.0, acv, 0.0, 0.0,
0.0, 0.0, 0.0, acv,
0.0, 0.0, 0.0, 0.5 },
{},
};
! private static int types[] = {
SEG_MOVETO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
--- 108,118 ----
{ 0.0, acv, 0.0, 0.0,
0.0, 0.0, 0.0, acv,
0.0, 0.0, 0.0, 0.5 },
{},
};
! private static int[] types = {
SEG_MOVETO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
SEG_LINETO, SEG_CUBICTO,
*** 139,149 ****
*/
public int currentSegment(float[] coords) {
if (isDone()) {
throw new NoSuchElementException("roundrect iterator out of bounds");
}
! double ctrls[] = ctrlpts[index];
int nc = 0;
for (int i = 0; i < ctrls.length; i += 4) {
coords[nc++] = (float) (x + ctrls[i + 0] * w + ctrls[i + 1] * aw);
coords[nc++] = (float) (y + ctrls[i + 2] * h + ctrls[i + 3] * ah);
}
--- 139,149 ----
*/
public int currentSegment(float[] coords) {
if (isDone()) {
throw new NoSuchElementException("roundrect iterator out of bounds");
}
! double[] ctrls = ctrlpts[index];
int nc = 0;
for (int i = 0; i < ctrls.length; i += 4) {
coords[nc++] = (float) (x + ctrls[i + 0] * w + ctrls[i + 1] * aw);
coords[nc++] = (float) (y + ctrls[i + 2] * h + ctrls[i + 3] * ah);
}
*** 173,183 ****
*/
public int currentSegment(double[] coords) {
if (isDone()) {
throw new NoSuchElementException("roundrect iterator out of bounds");
}
! double ctrls[] = ctrlpts[index];
int nc = 0;
for (int i = 0; i < ctrls.length; i += 4) {
coords[nc++] = (x + ctrls[i + 0] * w + ctrls[i + 1] * aw);
coords[nc++] = (y + ctrls[i + 2] * h + ctrls[i + 3] * ah);
}
--- 173,183 ----
*/
public int currentSegment(double[] coords) {
if (isDone()) {
throw new NoSuchElementException("roundrect iterator out of bounds");
}
! double[] ctrls = ctrlpts[index];
int nc = 0;
for (int i = 0; i < ctrls.length; i += 4) {
coords[nc++] = (x + ctrls[i + 0] * w + ctrls[i + 1] * aw);
coords[nc++] = (y + ctrls[i + 2] * h + ctrls[i + 3] * ah);
}
< prev index next >