@eclipse-glsp/graph
Version:
The typescript implementation of the GLSP graphical model (GModel)
28 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GAlignableBuilder = exports.isGAlignable = exports.GAlignable = void 0;
exports.GAlignable = Symbol('GAlignable');
function isGAlignable(element) {
return exports.GAlignable in element && element[exports.GAlignable] === true;
}
exports.isGAlignable = isGAlignable;
var GAlignableBuilder;
(function (GAlignableBuilder) {
function alignment(builder, pointOrX, y) {
const proxy = builder['proxy'];
if (typeof pointOrX === 'object') {
proxy.alignment = pointOrX;
}
else if (y !== undefined) {
proxy.alignment = { x: pointOrX, y };
}
else {
// Optionally handle cases where y is not provided
proxy.alignment = { x: pointOrX, y: 0 };
console.warn(`Incomplete parameters for GAlignableBuilder.alignment function. Setting alignment to ${JSON.stringify(proxy.alignment)}`);
}
return builder;
}
GAlignableBuilder.alignment = alignment;
})(GAlignableBuilder || (exports.GAlignableBuilder = GAlignableBuilder = {}));
//# sourceMappingURL=galignable.js.map