LoUtil: Add ordinate checks.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com> Change-Id: I6aaecbc05bafc0002d4bfea2dc0eb0c0ebe71ebc
This commit is contained in:
parent
f3b667b4e4
commit
469297e3cb
1 changed files with 28 additions and 0 deletions
|
@ -216,6 +216,34 @@ L.LOUtil = {
|
|||
return false;
|
||||
};
|
||||
|
||||
result.containsXOrdinate = function (ox) {
|
||||
if (ox >= result.x1 && ox <= result.x2)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
result.containsYOrdinate = function (oy) {
|
||||
if (oy >= result.y1 && oy <= result.y2)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
result.containsPixelOrdinateX = function (ox) {
|
||||
if (ox >= result.px.x1 && ox <= result.px.x2)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
result.containsPixelOrdinateY = function (oy) {
|
||||
if (oy >= result.px.y1 && oy <= result.px.y2)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
result.calculatePx = function () {
|
||||
result.px.x1 = Math.round(result.x1);
|
||||
result.px.x2 = Math.round(result.x2);
|
||||
|
|
Loading…
Reference in a new issue