mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-16 08:25:09 -04:00
added runtime errors at append and reverse of bezier polygons
This commit is contained in:
parent
8e0325a17b
commit
0aafead235
@ -166,6 +166,8 @@ public class Polygon implements Iterable<Vector> {
|
|||||||
* @return this for chained calls
|
* @return this for chained calls
|
||||||
*/
|
*/
|
||||||
public Polygon append(Polygon p2) {
|
public Polygon append(Polygon p2) {
|
||||||
|
if (!p2.isBezierStart.isEmpty())
|
||||||
|
throw new RuntimeException("append of bezier not supported");
|
||||||
for (int i = 1; i < p2.points.size(); i++)
|
for (int i = 1; i < p2.points.size(); i++)
|
||||||
points.add(p2.points.get(i));
|
points.add(p2.points.get(i));
|
||||||
return this;
|
return this;
|
||||||
@ -177,6 +179,8 @@ public class Polygon implements Iterable<Vector> {
|
|||||||
* @return returns this polygon with reverse order of points
|
* @return returns this polygon with reverse order of points
|
||||||
*/
|
*/
|
||||||
public Polygon reverse() {
|
public Polygon reverse() {
|
||||||
|
if (!isBezierStart.isEmpty())
|
||||||
|
throw new RuntimeException("reverse of bezier not supported");
|
||||||
Polygon p = new Polygon(closed);
|
Polygon p = new Polygon(closed);
|
||||||
for (int i = points.size() - 1; i >= 0; i--)
|
for (int i = points.size() - 1; i >= 0; i--)
|
||||||
p.add(points.get(i));
|
p.add(points.get(i));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user