Changeset 118:e32d45d47e18 for source


Ignore:
Timestamp:
Jan 19, 2009, 4:40:06 PM (15 years ago)
Author:
fnevgeny
Branch:
default
Phase:
public
Message:

Hide tracker when the pointer is outside of the viewport.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/class/pf/ui/canvas/Plotter.js

    r116 r118  
    8787                tracker.setLeft(tracker.dp.x + 12);
    8888                tracker.setTop(tracker.dp.y - 12);
     89               
     90                if (this.isInsideViewport(tracker.vp)) {
     91                    tracker.show();
     92                } else {
     93                    tracker.hide();
     94                }
    8995            }, this);
    9096       
     
    212218            this.w.xmax = Math.max(wxmin, wxmax);
    213219            this.w.ymax = Math.max(wymin, wymax);
     220        },
     221       
     222        isInsideViewport: function(vp) {
     223            var v = this.v;
     224            if (vp.x >= v.xmin && vp.x <= v.xmax &&
     225                vp.y >= v.ymin && vp.y <= v.ymax) {
     226                return true;
     227            } else {
     228                return false;
     229            }
    214230        },
    215231       
Note: See TracChangeset for help on using the changeset viewer.