OK, I am working on a new API and I am struggling with the way the new paths work with jumpGate. Given it is still in production I decided to add a toggle to the config of the API so the user can toggle if they are using JumpGate or not and thus I can render the paths differently depending on what the user is using.
That said... I tried to 'reverse the co-ordinates' for jumpGate but I fear there is something I am missing as the nice rounded rectangles I was able to produce are simply a mess now. code is below... any thoughts on what I am doing wrong?
I am more looking for an up to date version of this which has been my api bible for many, many months now: https://wiki.roll20.net/Mod:Objects/Path
EDIT: i wrote the jumpgate and old wrong on the image below., clearly I am after the rounded rectangle look and not whatever is happening with jumpgate.
drawRoundedRectangle: (pageId, x, y, width, height, radius, statusColor, layer = 'objects', questId, page) => { let pathData; if (QUEST_TRACKER_jumpGate) { pathData = [ ['M', -width / 2 + radius, height / 2], ['L', width / 2 - radius, height / 2], ['Q', width / 2, height / 2, width / 2, height / 2 - radius], ['L', width / 2, -height / 2 + radius], ['Q', width / 2, -height / 2, width / 2 - radius, -height / 2], ['L', -width / 2 + radius, -height / 2], ['Q', -width / 2, -height / 2, -width / 2, -height / 2 + radius], ['L', -width / 2, height / 2 - radius], ['Q', -width / 2, height / 2, -width / 2 + radius, height / 2], ['Z'] ]; } else { pathData = [ ['M', -width / 2 + radius, -height / 2], ['L', width / 2 - radius, -height / 2], ['Q', width / 2, -height / 2, width / 2, -height / 2 + radius], ['L', width / 2, height / 2 - radius], ['Q', width / 2, height / 2, width / 2 - radius, height / 2], ['L', -width / 2 + radius, height / 2], ['Q', -width / 2, height / 2, -width / 2, height / 2 - radius], ['L', -width / 2, -height / 2 + radius], ['Q', -width / 2, -height / 2, -width / 2 + radius, -height / 2], ['Z'] ]; } const rectObj = createObj('path', { _pageid: pageId, layer: layer, stroke: statusColor, fill: "#FAFAD2", left: x, top: y, width: width, height: height, path: JSON.stringify(pathData), stroke_width: 4, controlledby: '' }); if (rectObj) { H.storeQuestRef(questId, 'rectangle', rectObj.id); } }