igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
80 lines (79 loc) • 2.75 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, markType } from "./type";
import { isNaN_ } from "./number";
/**
* @hidden
*/
export let CanvasScalingHelpers = /*@__PURE__*/ (() => {
class CanvasScalingHelpers extends Base {
static b(a) {
if (a == null) {
return 1;
}
return CanvasScalingHelpers.c(a.rootWrapper);
}
static c(a) {
if (a == null) {
return 1;
}
let source_ = a.getNativeElement();
let sourceWidth_ = (source_.offsetWidth);
let rect_ = source_.getBoundingClientRect();
let rect_width_ = (rect_.width);
if (Math.abs(sourceWidth_ - rect_width_) > 1) {
return rect_width_ / sourceWidth_;
}
return 1;
}
static f(a) {
if (a == null) {
return 0;
}
return CanvasScalingHelpers.g(a.rootWrapper);
}
static g(a) {
if (a == null) {
return 0;
}
let source_ = a.getNativeElement();
let rect_ = source_.getBoundingClientRect();
let rect_width_ = (rect_.width);
return rect_width_;
}
static d(a) {
if (a == null) {
return 0;
}
return CanvasScalingHelpers.e(a.rootWrapper);
}
static e(a) {
if (a == null) {
return 0;
}
let source_ = a.getNativeElement();
let rect_ = source_.getBoundingClientRect();
let rect_width_ = (rect_.height);
return rect_width_;
}
static a(a, b, c) {
if (!isNaN_(a) && a != 0) {
return a;
}
let d = c * window.devicePixelRatio;
if (window.devicePixelRatio != undefined && d != b) {
return d;
}
return b;
}
static h(a, b) {
a.ao = 1 / b;
}
}
CanvasScalingHelpers.$t = markType(CanvasScalingHelpers, 'CanvasScalingHelpers');
return CanvasScalingHelpers;
})();