Lines Matching defs:Rect

85  *   new Rect(left, top, width, height)
86 * new Rect(width, height)
87 * new Rect(rect) // anything with left, top, width, height properties
88 * new Rect(bounds) // anything with left, top, right, bottom properties
89 * new Rect(canvas|image) // anything with width and height properties.
90 * new Rect() // empty rectangle.
93 function Rect() {
138 console.error('Invalid Rect constructor arguments:',
142 Rect.prototype = {
166 * @return {Rect} A rectangle with every dimension scaled.
168 Rect.prototype.scale = function(factor) {
169 return new Rect(
179 * @return {Rect} A rectangle shifted by (dx,dy), same size.
181 Rect.prototype.shift = function(dx, dy) {
182 return new Rect(this.left + dx, this.top + dy, this.width, this.height);
188 * @return {Rect} A rectangle with left==x and top==y, same size.
190 Rect.prototype.moveTo = function(x, y) {
191 return new Rect(x, y, this.width, this.height);
197 * @return {Rect} A rectangle inflated by (dx, dy), same center.
199 Rect.prototype.inflate = function(dx, dy) {
200 return new Rect(
209 Rect.prototype.inside = function(x, y) {
215 * @param {Rect} rect Rectangle to check.
218 Rect.prototype.intersects = function(rect) {
226 * @param {Rect} rect Rectangle to check.
229 Rect.prototype.contains = function(rect) {
239 Rect.prototype.isEmpty = function() {
246 * @param {Rect} bounds Bounds.
247 * @return {Rect} Calculated rectangle.
249 Rect.prototype.clamp = function(bounds) {
250 var rect = new Rect(this);
278 Rect.prototype.toString = function() {
290 * @param {Rect=} opt_dstRect Rectangle in the canvas (whole canvas by default).
291 * @param {Rect=} opt_srcRect Rectangle in the image (whole image by default).
293 Rect.drawImage = function(context, image, opt_dstRect, opt_srcRect) {
294 opt_dstRect = opt_dstRect || new Rect(context.canvas);
295 opt_srcRect = opt_srcRect || new Rect(image);
306 * @param {Rect} rect Rectangle.
308 Rect.outline = function(context, rect) {
316 * @param {Rect} rect Rectangle.
318 Rect.fill = function(context, rect) {
325 * @param {Rect} inner Inner rectangle.
326 * @param {Rect} outer Outer rectangle.
328 Rect.fillBetween = function(context, inner, outer) {