Skip to content

UI.offsetRectByRect

kerrishotts edited this page Apr 1, 2013 · 2 revisions

(part of UI)

Returns: rect object

Parameters: aRect (rect), bRect (rect)

Returns a copy of aRect shifted by bRect. Origin is shifted with the like origin from bRect, and the size is shifted with the like size from bRect.

Usage

var aRect = UI.makeRect ( UI.makePoint (10, 15), UI.makeSize (100, 150) );
var bRect = UI.makeRect ( UI.makePoint (10, -5), UI.makeSize (-5, 10 ) );
var cRect = UI.offsetRectByRect ( aRect, bRect );
// cRect is now { origin: { x: 20, y: 10 }, size: { w: 95, h: 160 } }

Version

0.3 Introduced; Docs Valid

Clone this wiki locally