X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=dev4%2Fpsychlops%2Fcore%2Fgraphic%2Fshape.cs;h=23cbecad2f42cf78a8854bd48d3147386026be52;hb=70d45b57ef59585bb8b82123d054014255d260ca;hp=d6ec7934e83e6ac67428cb12f79b8b4032389b90;hpb=2d16c7bc232e1d8e0f57404c4b37e3a8db6ab207;p=psychlops%2Fsilverlight.git diff --git a/dev4/psychlops/core/graphic/shape.cs b/dev4/psychlops/core/graphic/shape.cs index d6ec793..23cbeca 100644 --- a/dev4/psychlops/core/graphic/shape.cs +++ b/dev4/psychlops/core/graphic/shape.cs @@ -19,6 +19,10 @@ namespace Psychlops{ } public static class ShapeExtention { + public static void draw(this Shape drawee, double c) + { + drawee.draw( new Color(c) ); + } public static void draw(this Shape drawee, Color c) { Color tmp_col = drawee.fill; @@ -74,15 +78,17 @@ namespace Psychlops{ { set(v1, v2); } - public void set(double x1, double y1, double x2, double y2) + public Line set(double x1, double y1, double x2, double y2) { begin.set(x1, y1); end.set(x2, y2); + return this; } - public void set(Point v1, Point v2) + public Line set(Point v1, Point v2) { begin = v1; end = v2; + return this; } public Figure shift(Point p) @@ -101,7 +107,7 @@ namespace Psychlops{ return this; } - public void draw() + public virtual void draw() { Main.drawable.line(this); } @@ -200,7 +206,7 @@ namespace Psychlops{ return this; } - public void draw() + public virtual void draw() { Main.drawable.rect(this); } @@ -304,6 +310,13 @@ namespace Psychlops{ ydiameter = hei; return this; } + public Ellipse resize(double width, double height) + { + Point po = center; + set(width, height); + centering(po); + return this; + } public Figure shift(Point p) { datum += p; @@ -315,7 +328,7 @@ namespace Psychlops{ return this; } - public void draw() + public virtual void draw() { Main.drawable.ellipse(this); } @@ -387,7 +400,7 @@ namespace Psychlops{ return this; } - public void draw() + public virtual void draw() { Main.drawable.polygon(this); }