Browse Source

add getter/Setter on borderWidth and borderHeight

bstouls 8 years ago
parent
commit
2d67b8be5e
1 changed files with 14 additions and 2 deletions
  1. 14 2
      h2d/ScaleGrid.hx

+ 14 - 2
h2d/ScaleGrid.hx

@@ -3,8 +3,8 @@ package h2d;
 class ScaleGrid extends h2d.TileGroup {
 
 
-	public var borderWidth : Int;
-	public var borderHeight : Int;
+	public var borderWidth(default,set) : Int;
+	public var borderHeight(default,set) : Int;
 
 	public var width(default,set) : Int;
 	public var height(default,set) : Int;
@@ -50,6 +50,18 @@ class ScaleGrid extends h2d.TileGroup {
 		return h;
 	}
 
+	function set_borderWidth(w) {
+		this.borderWidth = w;
+		clear();
+		return w;
+	}
+
+	function set_borderHeight(h) {
+		this.borderHeight = h;
+		clear();
+		return h;
+	}
+
 	override function getBoundsRec(relativeTo, out, forSize) {
 		if( content.isEmpty() ) updateContent();
 		super.getBoundsRec(relativeTo, out, forSize);