MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / offset

Method offset

src/common/commontypes/Pixel.js:136–142  ·  view source on GitHub ↗

* @function Pixel.prototype.offset * @description 通过传入的 Pixel 参数对原屏幕坐标进行偏移。 * @example * var pixcel = new Pixel(100,50); * var pixcel2 = new Pixel(130,20); * //pixcel3 是新的对象 * var pixcel3 = pixcel.offset(pixcel2); * * @param {Pixel} px - 传入的 Pixel 对象。 * @re

(px)

Source from the content-addressed store, hash-verified

134 * @returns {Pixel} 新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
135 */
136 offset(px) {
137 var newPx = this.clone();
138 if (px) {
139 newPx = this.add(px.x, px.y);
140 }
141 return newPx;
142 }
143
144 /**
145 *

Callers 4

PixelSpec.jsFile · 0.80
jquery.jsFile · 0.80
sidebarScrollFixFunction · 0.80
scrollFunction · 0.80

Calls 2

cloneMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected