Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/html/lib/canvas/Rectangle.js
blob: 8f53412a86036947d1ef1ebcb18a52598b462b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
	Canvas control that draws a rectangle fitting the parameters specified in
	the _bounds_ property.
*/
enyo.kind({
	name: "enyo.canvas.Rectangle",
	kind: enyo.canvas.Shape,
	published: {
		clear: false
	},
	//* @protected
	renderSelf: function(ctx) {
		if (this.clear) {
			ctx.clearRect(this.bounds.l, this.bounds.t, this.bounds.w, this.bounds.h);
		} else {
			this.draw(ctx);
		}
	},
	fill: function(ctx) {
		ctx.fillRect(this.bounds.l, this.bounds.t, this.bounds.w, this.bounds.h);
	},
	outline: function(ctx) {
		ctx.strokeRect(this.bounds.l, this.bounds.t, this.bounds.w, this.bounds.h);
	}
});