From 017328ed9ea9feaf1312c06fc1dd1c4b9cb7da07 Mon Sep 17 00:00:00 2001 From: mdb Date: Sat, 27 Apr 2002 22:07:05 +0000 Subject: [PATCH] Apparently getBoundingBox() is used internally in various places and needs to not create a new Rectangle as well. git-svn-id: https://samskivert.googlecode.com/svn/trunk@715 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/swing/SmartPolygon.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/SmartPolygon.java b/projects/samskivert/src/java/com/samskivert/swing/SmartPolygon.java index ae3371a3..d7c69d43 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/SmartPolygon.java +++ b/projects/samskivert/src/java/com/samskivert/swing/SmartPolygon.java @@ -1,5 +1,5 @@ // -// $Id: SmartPolygon.java,v 1.1 2002/02/19 03:41:41 mdb Exp $ +// $Id: SmartPolygon.java,v 1.2 2002/04/27 22:07:05 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -38,4 +38,13 @@ public class SmartPolygon extends Polygon { return (bounds == null) ? super.getBounds() : bounds; } + + /** + * Returns the internally cached bounds rectangle for this polygon. + * Don't modify it! + */ + public Rectangle getBoundingBox () + { + return (bounds == null) ? super.getBoundingBox() : bounds; + } }