Giter Site home page Giter Site logo

Comments (5)

AlaaSarhan avatar AlaaSarhan commented on July 18, 2024 1

I tried with dragenter and dragleave .. issue there is that, with current behavior, an element won't be a child until it is dropped with it's bounding box entirely being inside the container, so highlighting the container on dragenter (which is triggered when mouse pointer is inside the container) might give false impression of being a parent of the dragged element if the users choose to drop the element when it is not entirely inside the container.

I'm experimenting with another alternative now, might be slightly more expensive computationally, but with some throttling it should work fine for a long time, I believe

from quickmockup.

AlaaSarhan avatar AlaaSarhan commented on July 18, 2024 1

@jdittrich new version on same branch should now solve the 2nd and 3rd of your points

from quickmockup.

jdittrich avatar jdittrich commented on July 18, 2024

That might be a tricky one, since the draw2D documentation does not mention the needed "dragover" event. It exists in the underlying jQueryUI, though.
Alternatively, one can try to trigger the outline on dragenter and undo it on dragleave

For highlighting, we could use the build-in glow

from quickmockup.

jdittrich avatar jdittrich commented on July 18, 2024
  • I tried for a while and did it did nothing until I noted: It only works for elements that are already on canvas, right? (many groupings would happen when people drag a new elements, so this is something we would need to figure out.
  • I wonder if the way to highlight all parent elements is not a bit brittle. Would it be possible or even easier to only highlight one (I guess we would not push to highlighted elements, but only have one elements there which is replaced by the next?). Cause when dragging quickly-ish, the outer element will not "notice" (we could bubble this up, but I guess it is not needed, and only highlighting one is easier)
  • I will probably make the glow a bit more visible (gree or blue) to make it easier to see, since our elements are gray-ish already.

from quickmockup.

AlaaSarhan avatar AlaaSarhan commented on July 18, 2024
* I tried for a while and did it did nothing until I noted: It only works for elements that are already on canvas, right? (many groupings would happen when people drag a new elements, so this is something we would need to figure out.

Yeap that is correct .. through their jQuery UI support, we can make it work for dom elements being dragged on top of the canvas .. but that also needs to wait until we have better dragged dom element rep. (like one that has same size, and probably rendered figure, of the final element that will be added to the canvas on drop) for better visual aid.

* I wonder if the way to highlight all parent elements is not a bit brittle. Would it be possible or even easier to only highlight one (I guess we would not push to highlighted elements, but only have one elements there which is replaced by the next?).  Cause when dragging quickly-ish, the outer element will not "notice" (we could bubble this up, but I guess it is not needed, and only highlighting one is easier)

This one is pretty weird. I tried to get rid of this effect of outer container being highlighted (by storing only last entered container as you have suggested) but the events are quite messy that it just introduced even more quirky behaviors .. I have an idea in mind to eventually solve and simplify a bit the logic, but will require introducing some state management within the canvas, using policies. I was thinking of opening a second issue for that, but let me try and see if I can quickly patch it up in this one, otherwise I'll create a separate issue.

* I will probably make the glow a bit more visible (gree or blue) to make it easier to see, since our elements are gray-ish already.

Yeap that's easy .. will apply a color changing filter + increase the size of the stroke by 2 instead of by 1

from quickmockup.

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.