[Chapter 12: Render Passes] Object selection

Great book, I really enjoy it!

In chapter 12, everything worked fine and I could do object selection as expected… until I noticed that the selected object was only highlighted when the app window was on my external display. When I run it on my primary laptop (macbook pro, with Intel i9 and Vega 20 graphics) display, the highlighting is gone. I can move the window back and forth between the displays and the highlighting goes on/off.

I am looking for advice on how to debug this.

Hi @armorix and welcome to the forums :slight_smile: !

I’m afraid I don’t have a non-Apple Silicon device any more to test it :unamused:

However, this could be related to the scale factor of the device not being x2 (although I thought the MacBook Pro i9 is x2), which I failed to take into account. If you try out the app on iPhone Pro Max, which has a scale factor of 3, it doesn’t work either.

This thread has the code to fix the problem:

Ah awesome! Thank you!

In my case, with my laptop display at 2x and my external monitor at 1x, I put the setting of params.scaleFactor in the draw func instead of init. Now it works when I drag the window from one display to the other. :+1:

1 Like

Hurray! I’m glad it worked.