Erweiterungen
This commit is contained in:
@@ -449,6 +449,15 @@
|
||||
ctx.lineTo(el.x + (el.width || 200), el.y);
|
||||
ctx.stroke();
|
||||
break;
|
||||
|
||||
case 'vline':
|
||||
ctx.strokeStyle = el.color || '#333333';
|
||||
ctx.lineWidth = el.strokeWidth || 1;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(el.x, el.y);
|
||||
ctx.lineTo(el.x, el.y + (el.height || 200));
|
||||
ctx.stroke();
|
||||
break;
|
||||
|
||||
case 'image':
|
||||
if (el.imageData) {
|
||||
@@ -699,6 +708,11 @@
|
||||
el.width = 200;
|
||||
el.height = 2;
|
||||
break;
|
||||
case 'vline':
|
||||
el.text = '';
|
||||
el.width = 2;
|
||||
el.height = 200;
|
||||
break;
|
||||
case 'image':
|
||||
el.text = 'Bild';
|
||||
el.width = 100;
|
||||
|
||||
@@ -265,7 +265,9 @@ window.initProfileInvoiceGenerator = function() {
|
||||
|
||||
// Always use black text for static elements, otherwise use element color
|
||||
ctx.fillStyle = el.isStatic ? '#000000' : (el.color || '#333333');
|
||||
ctx.font = (el.fontStyle || '') + ' ' + fontSize + 'px Arial';
|
||||
// Masterdata elements are never bold; other elements respect their fontStyle
|
||||
var fontWeight = (el.isStatic && !el.isCustomer) ? '' : (el.fontStyle || '');
|
||||
ctx.font = (fontWeight ? fontWeight + ' ' : '') + fontSize + 'px Arial';
|
||||
ctx.textBaseline = 'top';
|
||||
|
||||
lines.forEach(function(line) {
|
||||
@@ -1108,6 +1110,17 @@ window.initProfileInvoiceGenerator = function() {
|
||||
};
|
||||
};
|
||||
|
||||
window.updateProfileMasterdataValue = function(key, value) {
|
||||
if (!window.masterdataValues) window.masterdataValues = {};
|
||||
window.masterdataValues[key] = value;
|
||||
elements.forEach(function(el) {
|
||||
if (el.variable === key) {
|
||||
el.text = value;
|
||||
}
|
||||
});
|
||||
draw();
|
||||
};
|
||||
|
||||
draw();
|
||||
window.profileInvoiceState.initialized = true;
|
||||
console.log('Profile canvas initialized with ' + elements.length + ' elements');
|
||||
|
||||
Reference in New Issue
Block a user