Hello,
I want to put my custom Item on the top of the blue border. My code looks like this
function getCustomElement(shape, source) {
return {
x: 0,
y: 0,
width: shape.width,
height: shape.height,
href: source.dataURL
}
}
The element looks like this:
Should look like this:
Thanks.
I feel like both of these don’t look right. Wouldn’t you want the outline to have the width and height of the element?
How can I add the custom width to the outline?
The issue is that the outline doesn’t correspond with the dimensions of the rendered shape. Why that is, I can’t tell you unless you share your implementation.
My Code:
drawElement.js
import {
append as svgAppend,
create as svgCreate
} from 'tiny-svg';
const svgHTMLTag = "image";
export function drawCustomElement(parentNode, shape, source) {
const customElement = svgCreate(
svgHTMLTag,
getCustomElement(shape, source)
);
// append to parent
svgAppend(parentNode, customElement);
return customElement;
}
function getCustomElement(shape, source) {
return {
x: 0,
y: 0,
width: shape.width,
height: shape.height,
href: source.dataURL
}
}
which is called in CustomRenderer.js
drawShape(parentNode, element) {
...
const svg = drawCustomElement(parentNode, element, svgPath);
prependTo(svg, parentNode);
this.renderEmbeddedLabel(
parentNode,
element,
ALIGN_CENTER_MIDDLE,
getLabelColor(element, this.defaultLabelColor, this.defaultStrokeColor)
);
return svg;
...
return this.bpmnRenderer.drawShape(parentNode, element);
}
symas
December 15, 2022, 11:02pm
6
Hi @newUser
are you able to solve your problem? I have the same problem and do not find a solution.
see here: Change size of custom control - #3 by symas
perhaps @philippfromme can help me there?