drag

Drag item from one List to another List in SwiftUI

偶尔善良 提交于 2021-02-19 01:52:26
问题 I have two Lists each with simple items. I can rearrange items within a list, with the code shown below. I want to be able to drag an item from one list and drop it into the other list. Not sure what I need to enable to make that happen. As is, I can drag something from one list all over the screen, but I can't drop it anywhere except within its own list; if I release the drag anywhere else, it just flies back to its original location. Clearly, I need to add something(s) to enable the desired

Drag item from one List to another List in SwiftUI

不问归期 提交于 2021-02-19 01:52:08
问题 I have two Lists each with simple items. I can rearrange items within a list, with the code shown below. I want to be able to drag an item from one list and drop it into the other list. Not sure what I need to enable to make that happen. As is, I can drag something from one list all over the screen, but I can't drop it anywhere except within its own list; if I release the drag anywhere else, it just flies back to its original location. Clearly, I need to add something(s) to enable the desired

How to make selection box with free scaling in android

巧了我就是萌 提交于 2021-02-11 12:24:06
问题 Actually this question or this puzzle needs the heroes in mathematics :) I have some image and i want to add some selection box to make a crop .. for that i want to control from point 2 to scale horizontally or vertically .. I find some nice code but it is make scaling eventually in x and y with each together so i am making some manipulation to be able scale any axis dependently .. I have get success to do that in Y axis but no success for X axis This is the code : case MotionEvent.ACTION

Draggable lines select one another in Matplotlib

人盡茶涼 提交于 2021-02-07 17:58:39
问题 I'm trying to create a class of draggable lines using matplotlib handling and picking. The aim is to set different thresholds and intervals on a graph. Here is the code: import matplotlib.pyplot as plt import matplotlib.lines as lines import numpy as np class draggable_lines: def __init__(self, ax, kind, XorY): self.ax = ax self.c = ax.get_figure().canvas self.o = kind self.XorY = XorY if kind == "h": x = [-1, 1] y = [XorY, XorY] elif kind == "v": x = [XorY, XorY] y = [-1, 1] else: print(

Draggable lines select one another in Matplotlib

橙三吉。 提交于 2021-02-07 17:58:29
问题 I'm trying to create a class of draggable lines using matplotlib handling and picking. The aim is to set different thresholds and intervals on a graph. Here is the code: import matplotlib.pyplot as plt import matplotlib.lines as lines import numpy as np class draggable_lines: def __init__(self, ax, kind, XorY): self.ax = ax self.c = ax.get_figure().canvas self.o = kind self.XorY = XorY if kind == "h": x = [-1, 1] y = [XorY, XorY] elif kind == "v": x = [XorY, XorY] y = [-1, 1] else: print(

Draggable lines select one another in Matplotlib

半腔热情 提交于 2021-02-07 17:57:33
问题 I'm trying to create a class of draggable lines using matplotlib handling and picking. The aim is to set different thresholds and intervals on a graph. Here is the code: import matplotlib.pyplot as plt import matplotlib.lines as lines import numpy as np class draggable_lines: def __init__(self, ax, kind, XorY): self.ax = ax self.c = ax.get_figure().canvas self.o = kind self.XorY = XorY if kind == "h": x = [-1, 1] y = [XorY, XorY] elif kind == "v": x = [XorY, XorY] y = [-1, 1] else: print(

JavaFX mouse drag events not firing

女生的网名这么多〃 提交于 2021-01-28 02:50:48
问题 I tried almost everything, but the mouse drag events are not firing, like explained here: https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/input/MouseDragEvent.html Here is a minimal example, so you can try it out (I am using Java 11 with JavaFX 11.0.2): import javafx.application.Application; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.*; import javafx.stage.Stage; public class Main extends Application {

Drag PictureBox

半腔热情 提交于 2020-08-10 22:15:00
问题 I want to drag a PictureBox, and I have managed to do so. But my application doesn't do it as smoothly as Windows photo viewer. I mean the difference isn't huge or anything, but it's noticeable. Is there something I could do to make it a little less choppy? This is my simple code: int MOUSE_X = 0; int MOUSE_Y = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { picBox.Image = Image.FromFile(@"D:\test_big.png"); picBox.Width = 3300; picBox.Height

Drag PictureBox

白昼怎懂夜的黑 提交于 2020-08-10 22:13:07
问题 I want to drag a PictureBox, and I have managed to do so. But my application doesn't do it as smoothly as Windows photo viewer. I mean the difference isn't huge or anything, but it's noticeable. Is there something I could do to make it a little less choppy? This is my simple code: int MOUSE_X = 0; int MOUSE_Y = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { picBox.Image = Image.FromFile(@"D:\test_big.png"); picBox.Width = 3300; picBox.Height