Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » how to convert view point to logic point (Painter point convert)
Re: how to convert view point to logic point [message #55838 is a reply to message #55837] Sun, 20 December 2020 09:43 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14257
Registered: November 2005
Ultimate Member
zouql wrote on Sun, 20 December 2020 08:45
Hi all:
when using Painter's scale/translate/rotate, it convert the user's
point to view point. So when mouse event LeftDown(Point p,dword flags),
the Point p is view point, Is there any way to convert this viewpoint
to user point for user's comparison and judgment logic?


If you need to handle this in really generic way, I think the best is to use the transformation matrix - Xform2D.

I would probably stopped using scale/translate/rotate and instead created a method that creates Xform2D (by multiplying with Xform2D::Scale, Rotate, Translate), then assign this whole matrix to Painter (using Transform method). Then, to convert view point back, compute Inverse matrix and use Xform2D::Transform...
 
Read Message
Read Message
Read Message icon14.gif
Read Message
Previous Topic: Draw linker errors with freetype 2.10.4
Next Topic: [PATCH READY] New plugin/icons/silk
Goto Forum:
  


Current Time: Sun May 11 02:06:58 CEST 2025

Total time taken to generate the page: 0.03173 seconds