26 lines
511 B
JavaScript
26 lines
511 B
JavaScript
class Object {
|
|
constructor(x, y, w, h) {
|
|
this.x = x;
|
|
this.y = y;
|
|
this.width = w;
|
|
this.height = h;
|
|
}
|
|
}
|
|
|
|
export class Rect extends Object {
|
|
constructor(x, y, w, h, fillColor = 'white') {
|
|
super(x, y, w, h);
|
|
|
|
this.fillColor = fillColor;
|
|
}
|
|
}
|
|
|
|
export class StrokeRect extends Rect {
|
|
constructor(x, y, w, h, fillColor = 'white', strokeColor = 'black', strokeWidth = 1) {
|
|
super(x, y, w, h, fillColor);
|
|
|
|
this.strokeWidth = strokeWidth;
|
|
this.strokeColor = strokeColor;
|
|
}
|
|
}
|