[PATCH] DIX/ConfineTo: Improve algorithm to jump to the nearest point inside

Keith Packard keithp at keithp.com
Sat Nov 23 21:46:09 PST 2013


Keith Packard <keithp at keithp.com> writes:

> Egbert Eich <eich at freedesktop.org> writes:
>
>> ConfineToShape does not work well: The cursor often times doesn't jump
>> to the point closest to the current cursor position outside the shape.
>> This patch fixes this.
>
> I came up with something a bit simpler which confines the point to each
> box in the region and then picks the result which moves the cursor the
> shortest distance. I think it would generate the same result, but I
> stuck a bunch of range tests in the distance computation to avoid
> overflow in weird cases. Dunno if you like this better or not?

I didn't see any replies to this comment; would be nice to merge this at
some point.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131123/5acaf3c0/attachment.pgp>


More information about the xorg-devel mailing list