Kamujin's picture

Incorrect XDelta and YDelta values in MouseMoveEventArgs

Project:The Open Toolkit library
Version:0.9.8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

In MouseDevice.cs line 195

        /// <summary>
 
        /// Sets a System.Drawing.Point representing the absolute position of the pointer, in window pixel coordinates.
 
        /// </summary>
 
        internal Point Position
 
        {
 
            set
 
            {
 
                pos = value;
 
                last_pos = pos;
 
 
 
                Move(this, new MouseMoveEventArgs(pos.X, pos.Y, pos.X - last_pos.X, pos.Y - last_pos.Y));
 
            }
 
        }

last_pos needs to be updated after the event is fired as below.

        /// <summary>
        /// Sets a System.Drawing.Point representing the absolute position of the pointer, in window pixel coordinates.
        /// </summary>
        internal Point Position
        {
            set
            {
                pos = value;
 
                Move(this, new MouseMoveEventArgs(pos.X, pos.Y, pos.X - last_pos.X, pos.Y - last_pos.Y));
 
                last_pos = pos;
            }
        }

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» fixed

Fixed in rev. 1690.

the Fiddler's picture

#2

Version:0.9.7» 0.9.8
Status:fixed» closed

Closing issues fixed in 0.9.8.