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)
how to convert view point to logic point [message #55837] Sun, 20 December 2020 08:45 Go to next message
zouql is currently offline  zouql
Messages: 15
Registered: December 2020
Location: China
Promising Member
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?
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 next message
mirek is currently offline  mirek
Messages: 13986
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...
icon14.gif  Re: how to convert view point to logic point [message #55839 is a reply to message #55838] Sun, 20 December 2020 09:54 Go to previous messageGo to next message
zouql is currently offline  zouql
Messages: 15
Registered: December 2020
Location: China
Promising Member
Thank you, mirek,
The response was quick.
Looking forward to your improvement. Laughing
Re: how to convert view point to logic point [message #55840 is a reply to message #55839] Sun, 20 December 2020 13:09 Go to previous message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
zouql wrote on Sun, 20 December 2020 09:54
Thank you, mirek,
The response was quick.
Looking forward to your improvement. Laughing


Eh, just to be clear, while there are multitudes of improvements of U++ happening now, there is none planned for this particular case - there is a clear solution with existing U++.

By "I would" I mean how I would do it if I was in your place... Smile

Mirek
Previous Topic: Draw linker errors with freetype 2.10.4
Next Topic: [PATCH READY] New plugin/icons/silk
Goto Forum:
  


Current Time: Tue Jun 25 19:32:05 CEST 2024

Total time taken to generate the page: 0.01684 seconds