Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1244 for trunk/sources


Ignore:
Timestamp:
03/03/09 20:50:20 (16 years ago)
Author:
mstoeger
Message:

Fixed MouseMove event bug with some mouse drivers (#503)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/LineChart.cs

    r1242 r1244  
    11using System;
    22using System.Collections.Generic;
     3using System.Diagnostics;
    34using System.Drawing;
    45using System.Windows.Forms;
     
    390391    }
    391392
     393    private Point prevMousePosition = Point.Empty;
     394
    392395    private void canvas_MouseMove(object sender, MouseEventArgs e) {
    393       double x = Transform.ToWorldX(e.X, berni.Viewport, berni.ClippingArea);
    394       double y = Transform.ToWorldY(e.Y, berni.Viewport, berni.ClippingArea);
    395 
    396       mousePointer.Rectangle = new RectangleD(x-1, y-1, x+1, y+1);
    397       canvasUI.Invalidate();
     396      if (prevMousePosition != e.Location) {
     397        prevMousePosition = e.Location;
     398
     399        double x = Transform.ToWorldX(e.X, berni.Viewport, berni.ClippingArea);
     400        double y = Transform.ToWorldY(e.Y, berni.Viewport, berni.ClippingArea);
     401
     402        mousePointer.Rectangle = new RectangleD(x - 1, y - 1, x + 1, y + 1);
     403        canvasUI.Invalidate();
     404      }
    398405    }
    399406
Note: See TracChangeset for help on using the changeset viewer.