contentScaleFactor not working correctly

I have not tested without setDesignResolution. I want to use the default visibleOrigin or getVisibleSize(). May be you are right. When I was using glview->setDesignResolutionSize(1280.0f, 720.0f, ResolutionPolicy::NO_BORDER), you can see from Test Case 4, my output was

Bounding HW= 675.000000 1200.000000

This is not equal to frameSize or designResolutionSize. That’s why I got confused.

So, I have not tested without these two. What I wanted, I got that, that’s why I did not go into further testing. But you can test and post the results with snaps. :smiley:

  • About getVisibleSize() and getVisibleOrigin()

You can use it if you want, but getVisibleOrigin() will always be equal to (0, 0) and getVisibleSize() will always be equal to the frame size in your case (use setDesignResolutionSize(frameSize.width, frameSize.height, ResolutionPolicy::NO_BORDER) or do not use setDesignResolutionSize()).

  • About Test Case 4

In your code, you use

It is OK. But then you use

This is the cause of the wrong result. You do not need to use setContentScaleFactor() in this case.
And then boundingBox will be equal to the size of the image in this case.

Ok. I will keep it in mind. :smiley:

In my previous post there was an error, now I edited it.

Sorry about it.

1 Like