Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tool for testing SCREEN viewport (Lububtu's bug)
#2
I don't think you're really seeing a bug here.  You're getting the mouse coordinates properly.  You're just mathing them wrongly to get the correct row.

For example, the let's say the font is 8 pixels in size.

From Y 0 to Y7, that's row 1. 
From Y8 to Y15, that's row 2.

Your math is simply:  

row = INT(_MouseY / _FontHeight)

So when the mouse is at pixel 0, it's going to report being in row INT(0/8).. or 0.
Now when it's at pixel 8, it's going to report being in row INT(8/8).. or 1.

Mouse starts at base 0, but row counting starts on the first row.  

You basically need to offset the math there to adjust for that +1 base difference.  Big Grin

(Note that in SCREEN 0, this offset is *NOT* needed as screen 0 gives us the row value automatically so it begins with a base value of 1, whereas mouse begins with a base value of 0.)
Reply


Messages In This Thread
RE: Tool for testing SCREEN viewport (Lububtu's bug) - by SMcNeill - 11-17-2025, 02:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Screen fonts in SCREEN 0 BDS107 14 3,570 07-08-2025, 08:05 PM
Last Post: madscijr
  Pete's Handy Dandy File Compare Tool Pete 0 526 11-12-2024, 02:39 AM
Last Post: Pete
  Pete's handy dandy compare tool... Pete 0 573 10-25-2024, 01:20 AM
Last Post: Pete
  TreeSheets: A fantastic little outlining tool CharlieJV 7 2,382 06-28-2023, 08:11 PM
Last Post: CharlieJV
  FeatherWiki, super-light tool that's handy for all sorts of things. CharlieJV 0 480 03-26-2023, 07:19 PM
Last Post: CharlieJV

Forum Jump:


Users browsing this thread: 1 Guest(s)