Possibly incorrect calculation in rescaleValuatorAxis

Michael Thayer michael.thayer at oracle.com
Mon Aug 1 15:01:43 PDT 2011


I'm not familiar with the code in question, so please excuse me if I am
wrong here.  rescaleValuatorAxis in dix/getevents.c does a call to
lroundf to round up the result.  It seems to me that it should actually
always round down.  With the current code as I read it, if I am scaling
an axis with range 0 to 0x10000 to a screen width of 1024, values 0 to
31 on my axis translate to pixel 0, values 32 to 95 to pixel 1, values
96 to 159 to pixel 2 and so on; basically everything is shifted half a
pixel to the right.

Regards,

Michael
-- 
ORACLE Deutschland B.V. & Co. KG   Michael Thayer
Werkstrasse 24                     VirtualBox engineering
71384 Weinstadt, Germany           mailto:michael.thayer at oracle.com

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven



More information about the xorg-devel mailing list