Skip to content

Commit

Permalink
fix open halo for alt drag
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-client-morphic-selecting.js,AUTO-COMMIT-src-components-widgets-lively-window.js,
  • Loading branch information
JensLincke committed Jan 3, 2024
1 parent 8ea96f6 commit f2a8e7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/client/morphic/selecting.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class Selecting {

static handleMouseUp(evt) {

// var rect = lively.showEvent(evt, {
// lively.showEvent(evt, {
// background: "rgba(0,100,0,0.7)",
// fontSize: "8pt",
// animate: true,
Expand Down
15 changes: 9 additions & 6 deletions src/components/widgets/lively-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,10 @@ export default class Window extends Morph {
onWindowMouseMove(evt) {
// var div = lively.showEvent(evt)
// div.style.background = "rgba(0,200,0,0.3)"
// div.innerHTML = "M" + lively.isDragging
// div.innerHTML = "M " + lively.isDragging



// lively.showEvent(evt, {background: "rgba(0,200,0,0.3)", text: "M" + lively.isDragging})

if (this.dragging) {
evt.preventDefault();
Expand All @@ -524,8 +524,10 @@ export default class Window extends Morph {
lively.setPosition(this, Grid.optSnapPosition(pos, evt))
}

if (this.dragging.dist(pt(evt.pageX, evt.pageY) > 10)) {
livley.isDragging = true
if (this.dragging.dist(pt(evt.pageX, evt.pageY)) > 10) {
// lively.showEvent(evt, {background: "rgba(0,200,0,0.3)", text: "M" + lively.isDragging})
lively.isDragging = true

}

lively.lastDragTime = Date.now()
Expand All @@ -536,9 +538,10 @@ export default class Window extends Morph {
async onWindowMouseUp(evt) {
// lively.showEvent(evt).innerHTML = "pointer UP"
evt.preventDefault();
lively.sleep(0).then(() => {
lively.sleep(10).then(() => {
// keep dragging active for the click?
this.dragging = false;
lively.isDragging = false
})

if (lively.preferences.get("TabbedWindows")) {
Expand All @@ -554,7 +557,7 @@ export default class Window extends Morph {
await this.createTabsWrapper(evt);
}
this.dropintoOtherWindow = null;
lively.isDragging = false

}

// Prevent Mouse interaction when alt dragging
Expand Down

0 comments on commit f2a8e7a

Please sign in to comment.