1
function placeEditBubble(mouse) {
2
// Find the root item, then map our cursor position to it
3
// in order to check if the edit bubble could end up off-screen
5
while (rootItem.parent) {
6
rootItem = rootItem.parent;
8
var distanceToTop = mouseEventListener.mapToItem(rootItem, mouse.x, mouse.y);
9
//print( " distanceToTop: " + distanceToTop.x);
10
if (distanceToTop.x < editBubble.width/2) {
11
// hitting the left edge
12
//editBubble.x = mouse.x
15
editBubble.x = mouse.x-(editBubble.width/2)
17
if (distanceToTop.y > editBubble.height) {
18
editBubble.y = mouse.y-editBubble.height-8
20
//editBubble.y = mouse.y-(editBubble.width/2)