draggable

Resizing Handles on a Rotated Element

一笑奈何 提交于 2019-12-12 07:56:02
问题 I'm trying to put resizing handles on the four corners of a rectangle, which can be dragged to resize the rectangle. What I'm having trouble with is calculating the new width, new height, and new points of the rectangle after I've dragged one of the rectangle's points. If the rectangle were not rotated, this would obviously be very easy because the width and height would change by the same amout as the mouse's offsetX and offsetY. However, this rectangle CAN be rotated, so offsetX and offsetY

HTML5, JavaScript: Drag and Drop File from External Window (Windows Explorer)

怎甘沉沦 提交于 2019-12-12 07:06:52
问题 Can I kindly ask for a good working example of HTML5 File Drag and Drop implementation? The source code should work if drag and drop is performed from external application(Windows Explorer) to browser window. It should work on as many browsers as possible. I would like to ask for a sample code with good explanation. I do not wish to use third party libraries, as I will need to modify the code according to my needs. The code should be based on HTML5 and JavaScript . I do not wish to use JQuery

ImageIcon click and drag around the window

旧街凉风 提交于 2019-12-12 06:33:26
问题 I'm trying to make it so I can click and drag an ImageIcon (in this case a card image but I'd like to learn how to do it generally) around the window but I don't really know how. I would like to be able to click and hold the mouse botton, drag the ImageIcon, and have stay where it is whn I release the mouse botton. This is the code I have so far: import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener;

How to drag a graph around the window in OpenGL/c++

☆樱花仙子☆ 提交于 2019-12-12 05:42:28
问题 below is the code so far, my problem lies in dragging the graph around the window ? i can't seem to do it ? any tips for me guys ?? What i want is when you click and hold down the left mouse button you should be able to drag the graph around the window ? #include <GL/glut.h> #include <stdlib.h> #include <math.h> #if !defined(GLUT_WHEEL_UP) # define GLUT_WHEEL_UP # define GLUT_WHEEL_DOWN 4 #endif /* Set initial size of the display window. */ GLsizei winWidth = 600, winHeight = 600; /* Set size

Proper way to move a JavaFx8 node around

送分小仙女□ 提交于 2019-12-12 04:52:50
问题 I am working on an app which needs to move nodes around on a pane. I've just recently started learning javaFx 8 so I have bare understanding of the workflow, but while I managed to get a working draggable node code working, it uses node.setTranslateX() and .setTranslateY(). This is all fine, until I tried to make the node snap to a grid that divides the scene area in both 10 height and width subdivisions. Whenever I try to use modulos to get some sort of snapping going on, I'm stuck with the

How to resize parent by dragging one of it's children?

徘徊边缘 提交于 2019-12-12 04:14:16
问题 Essentially i want to resize the green box by dragging the blue thing. I'm trying to use OffsetLeft but is not working. also the drag event doesn't fire in Firefox. And i have the code here: jsbin link <div id="parent"> <div draggable="true" id="child" ondrag="dragging(event)" ></div> </div> <script> const parent = document.getElementById('parent'); const child = document.getElementById('child'); function dragging(event) { console.log("dragging"); parent.style.width = child.offsetLeft; } <

KonvaJS, masking instead of clipFunc possible?

不想你离开。 提交于 2019-12-12 04:07:57
问题 i'm using konvajs and need some help! Assume that i need an image that draggable inside a complex shape. So i wonder that can it be possible to using masking with Konva.Group instead of clipFunc OR a way to convert an masking image to canvas-clip-path and use with clipFunc! like this: Masking draggable 回答1: By default Konva supports only simple clip with rectangle shape and clipping with clipFunc where you can describe required path. https://konvajs.github.io/docs/clipping/Clipping_Function

javascript - how to make multiple draggable clones?

╄→гoц情女王★ 提交于 2019-12-12 03:56:59
问题 now I'm trying to make a simple drag and drop game. The first time I drag and drop a clone works fine, but it doesn't allow me to drag a clone anymore. So I want to create as many clones as I drag.... and I have no idea how to do it. Please take a look at my code first. function init(){ var xCoordinate; var yCoordinate; var itemName; $('#burger, #chicken, #fries, #hotdog, #soda').draggable({ containment: '#screen', start: getPosition, helper: 'clone', stop: dragStop, revert: 'invalid' }); $('

how to use draggable and click separately in kineticjs?

吃可爱长大的小学妹 提交于 2019-12-12 03:54:32
问题 how to use draggable and click on same node in kineticjs? when using draggable then a click event fires also after drag. in jsfiddle, http://jsfiddle.net/matobaa/LZ5tt/ Here is the code... var stage = new Kinetic.Stage({ container: 'container', width: 640, height: 480 }); var layer = new Kinetic.Layer(); var oval = new Kinetic.Ellipse({ x: 100, y: 100, radius: 50, stroke: 'red', draggable: true, }); oval.on('click', function(evt) { alert("clicked!"); // Will not be triggered after drag })

JavaFX8 - drag a pane within a ScrollPane

旧巷老猫 提交于 2019-12-12 03:46:49
问题 Base on this comment https://stackoverflow.com/a/29530135/1387524 I added a ScrollPane to use scrolling when the canvas is moved outside of the visible area. When I drag the canvas to the right or the bottom the scrollbars are displayed. But when I drag to the left or to the top nothing happens. What am I missing? import javafx.application.Application; import javafx.beans.property.DoubleProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.event.EventHandler; import