Skip to content

Commit 6821022

Browse files
committed
getRepresentationPosition bubble
1 parent 80367f6 commit 6821022

File tree

1 file changed

+19
-5
lines changed
  • services/static-webserver/client/source/class/osparc/workbench

1 file changed

+19
-5
lines changed

services/static-webserver/client/source/class/osparc/workbench/Annotation.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,25 @@ qx.Class.define("osparc.workbench.Annotation", {
154154
getRepresentationPosition: function() {
155155
const representation = this.getRepresentation();
156156
if (representation) {
157-
const attrs = osparc.wrapper.Svg.getRectAttributes(representation);
158-
return {
159-
x: parseInt(attrs.x),
160-
y: parseInt(attrs.y)
161-
};
157+
switch (this.getType()) {
158+
case this.self().TYPES.RECT:
159+
case this.self().TYPES.TEXT:
160+
case this.self().TYPES.NOTE: {
161+
const attrs = osparc.wrapper.Svg.getRectAttributes(representation);
162+
return {
163+
x: parseInt(attrs.x),
164+
y: parseInt(attrs.y),
165+
};
166+
}
167+
case this.self().TYPES.CONVERSATION: {
168+
const x = representation.transform().x;
169+
const y = representation.transform().y;
170+
return {
171+
x,
172+
y,
173+
};
174+
}
175+
}
162176
}
163177
return null;
164178
},

0 commit comments

Comments
 (0)