Beispiel #1
0
        public void SetScrollPos(bool vertical, int pos, bool notify)
        {
            _GetScrollInfo(vertical, out var k);
            pos = AMath.MinMax(pos, k.nMin, k.nMax);
            if (pos == k.nPos)
            {
                return;
            }
            k.nPos = pos;

            ref var x = ref (vertical ? ref _v : ref _h);
Beispiel #2
0
            public bool Detect(POINT pt)
            {
                //get normal x y. In pt can be outside screen when cursor moved fast and was stopped by a screen edge. Tested: never for click/wheel events.
                //AOutput.Write(pt, AMouse.XY);
                //var r = AScreen.Of(pt).Bounds; //problem with empty corners between 2 unaligned screens: when mouse tries to quickly diagonally cut such a corner, may activate a wrong trigger
                var r = AScreen.Of(AMouse.XY).Bounds;                 //smaller problem: AMouse.XY gets previous coordinates

                _xmin = r.left; _ymin = r.top; _xmax = r.right - 1; _ymax = r.bottom - 1;
                _x    = AMath.MinMax(pt.x, _xmin, _xmax);
                _y    = AMath.MinMax(pt.y, _ymin, _ymax);
                //AOutput.Write(pt, _x, _y, r);

                result    = default;
                result.pt = (_x, _y);

                _Detect();
                _prev.xx = _x; _prev.yy = _y;

#if DEBUG
                //AOutput.Write(++_prev.debug, edgeEvent, moveEvent, (_x, _y));
#endif
                return(result.edgeEvent != 0 || result.moveEvent != 0);
            }