Coder Social home page Coder Social logo

holdDelay about gojs HOT 3 CLOSED

northwoodssoftware avatar northwoodssoftware commented on May 3, 2024
holdDelay

from gojs.

Comments (3)

WalterNorthwoods avatar WalterNorthwoods commented on May 3, 2024

The ToolManager.holdDelay property just controls when the Tool.doWaitAfter method is called. The default value is 850 milliseconds. A timer is started upon mouse-down, is restarted on mouse-move beyond a certain distance (Tool.isBeyondDragSize), and is cancelled upon mouse-up and in a few other circumstances.

The DragSelectingTool.delay property controls how long to wait before DragSelectingTool.canStart can return true. The default value is 175 milliseconds. No timer is involved.

So the ToolManager.holdDelay property should not affect the behavior of the DragSelectingTool.

I believe the user does have to move the mouse after a mouseHold event in order to get a new mouseHold event. The same goes for mouseHover events, which implement tooltips. So that might explain why sometimes you do not get any event.

I cannot explain why the timings are less than 800ms. We'll investigate. I suspect it's interacting with waiting for mouseHover events.

from gojs.

WalterNorthwoods avatar WalterNorthwoods commented on May 3, 2024

Ah, this is a bug in your test code. You wrote:

    myDiagram.toolManager.doMouseDown=function(){
        start = new Date().getTime();
        go.Tool.prototype.doMouseDown.call(myDiagram.toolManager)
    }

But the call to the overridden method should have been:

    myDiagram.toolManager.doMouseDown=function(){
        start = new Date().getTime();
        go.ToolManager.prototype.doMouseDown.call(myDiagram.toolManager)
    }

Basically, your code was not calling the normal ToolManager.doMouseDown functionality.

With the fix I am consistently getting times of about 850-860 ms.

from gojs.

martienvlent avatar martienvlent commented on May 3, 2024

Oops.
Thanks for the swift reply.

Groeten, Martien


Van: WalterNorthwoodsmailto:[email protected]
Verzonden: ‎16-‎6-‎2016 14:48
Aan: NorthwoodsSoftware/GoJSmailto:[email protected]
CC: Martien van Lentmailto:[email protected]; Authormailto:[email protected]
Onderwerp: Re: [NorthwoodsSoftware/GoJS] holdDelay (#24)

Ah, this is a bug in your test code. You wrote:

    myDiagram.toolManager.doMouseDown=function(){
        start = new Date().getTime();
        go.Tool.prototype.doMouseDown.call(myDiagram.toolManager)
    }

But the call to the overridden method should have been:

    myDiagram.toolManager.doMouseDown=function(){
        start = new Date().getTime();
        go.ToolManager.prototype.doMouseDown.call(myDiagram.toolManager)
    }

Basically, your code was not calling the normal ToolManager.doMouseDown functionality.

With the fix I am consistently getting times of about 850-860 ms.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#24 (comment)

from gojs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.