mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
* Source/GSSlideView.m: (- _slideFrom:to:): Calcuate number of
steps wrt image size. * Source/GSDragView.m: (- slideDraggedImageTo:): Ditto. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24831 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3c82286530
commit
604f3cabf2
3 changed files with 26 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-03-09 Sergii Stoian <stoyan255@yahoo.com>
|
||||||
|
|
||||||
|
* Source/GSSlideView.m: (- _slideFrom:to:): Calcuate number of
|
||||||
|
steps wrt image size.
|
||||||
|
* Source/GSDragView.m: (- slideDraggedImageTo:): Ditto.
|
||||||
|
|
||||||
2007-03-08 Fred Kiefer <FredKiefer@gmx.de>
|
2007-03-08 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/AppKit/NSResponder.h: Move _rFlags from here ...
|
* Headers/AppKit/NSResponder.h: Move _rFlags from here ...
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
|
|
||||||
#include "GNUstepGUI/GSDisplayServer.h"
|
#include "GNUstepGUI/GSDisplayServer.h"
|
||||||
#include "GNUstepGUI/GSDragView.h"
|
#include "GNUstepGUI/GSDragView.h"
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
/* Size of the dragged window */
|
/* Size of the dragged window */
|
||||||
#define DWZ 48
|
#define DWZ 48
|
||||||
|
@ -271,15 +272,27 @@ static GSDragView *sharedDragView = nil;
|
||||||
|
|
||||||
- (void) slideDraggedImageTo: (NSPoint)point
|
- (void) slideDraggedImageTo: (NSPoint)point
|
||||||
{
|
{
|
||||||
|
float distx = point.x - dragPosition.x;
|
||||||
|
float disty = point.y - dragPosition.y;
|
||||||
|
float dist = sqrt((distx * distx) + (disty * disty));
|
||||||
|
NSSize imgSize = [[dragCell image] size];
|
||||||
|
float imgDist = sqrt((imgSize.width * imgSize.width) +
|
||||||
|
(imgSize.height * imgSize.height));
|
||||||
|
int steps = (int)(dist/imgDist);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert point from coordinates of image to coordinates of mouse
|
* Convert point from coordinates of image to coordinates of mouse
|
||||||
* cursor for internal use.
|
* cursor for internal use.
|
||||||
*/
|
*/
|
||||||
point.x += offset.width;
|
point.x += offset.width;
|
||||||
point.y += offset.height;
|
point.y += offset.height;
|
||||||
[self _slideDraggedImageTo: point
|
/* [self _slideDraggedImageTo: point
|
||||||
numberOfSteps: SLIDE_NR_OF_STEPS
|
numberOfSteps: SLIDE_NR_OF_STEPS
|
||||||
delay: SLIDE_TIME_STEP
|
delay: SLIDE_TIME_STEP
|
||||||
|
waitAfterSlide: YES];*/
|
||||||
|
[self _slideDraggedImageTo: point
|
||||||
|
numberOfSteps: steps
|
||||||
|
delay: SLIDE_TIME_STEP
|
||||||
waitAfterSlide: YES];
|
waitAfterSlide: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,10 +70,15 @@
|
||||||
float distx = toPoint.x - fromPoint.x;
|
float distx = toPoint.x - fromPoint.x;
|
||||||
float disty = toPoint.y - fromPoint.y;
|
float disty = toPoint.y - fromPoint.y;
|
||||||
float dist = sqrt((distx * distx) + (disty * disty));
|
float dist = sqrt((distx * distx) + (disty * disty));
|
||||||
int steps = (int)(dist / MINDIST);
|
// int steps = (int)(dist / MINDIST);
|
||||||
|
NSSize imgSize = [[slideCell image] size];
|
||||||
|
float imgDist = sqrt((imgSize.width * imgSize.width) +
|
||||||
|
(imgSize.height * imgSize.height));
|
||||||
|
int steps = (int)(dist/imgDist);
|
||||||
int windowNumber = [_window windowNumber];
|
int windowNumber = [_window windowNumber];
|
||||||
GSDisplayServer *server = GSServerForWindow(_window);
|
GSDisplayServer *server = GSServerForWindow(_window);
|
||||||
|
|
||||||
|
|
||||||
if (steps > 2)
|
if (steps > 2)
|
||||||
{
|
{
|
||||||
float unitx = distx / steps;
|
float unitx = distx / steps;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue