r3-legacy/src/r3-api-canvas.js

61 lines
1.4 KiB
JavaScript

/**
* R3.API.Canvas
* @param apiComponent
* @constructor
*/
R3.API.Canvas = function(
apiComponent
) {
__API_COMPONENT__;
if (R3.Utils.UndefinedOrNull(apiComponent.autoUpdateSize)) {
apiComponent.autoUpdateSize = true;
}
this.autoUpdateSize = apiComponent.autoUpdateSize;
if (R3.Utils.UndefinedOrNull(apiComponent.width)) {
apiComponent.width = 450;
}
this.width = apiComponent.width;
this.guiInfo.width = {
range: [0, 5120],
step: 1,
dp: 0
};
if (R3.Utils.UndefinedOrNull(apiComponent.height)) {
apiComponent.height = 450;
}
this.height = apiComponent.height;
this.guiInfo.height = {
range: [0, 5120],
step: 1,
dp: 0
};
if (R3.Utils.UndefinedOrNull(apiComponent.tabIndex)) {
apiComponent.tabIndex = 1;
}
this.tabIndex = apiComponent.tabIndex;
this.guiInfo.tabIndex = {
range: [0, 100],
step: 1,
dp: 0
};
if (R3.Utils.UndefinedOrNull(apiComponent.texts)) {
apiComponent.texts = [];
}
this.texts = apiComponent.texts;
if (R3.Utils.UndefinedOrNull(apiComponent.textBaseline)) {
apiComponent.textBaseline = 'middle';
}
this.textBaseline = apiComponent.textBaseline;
};
R3.API.Canvas.prototype = Object.create(R3.API.Component.prototype);
R3.API.Canvas.prototype.constructor = R3.API.Canvas;