zoom in causes shrinking TPanel (FMX, Win32)


I’m using a TPanel to draw on (placing rectangles on it). It is set to Align to Client (fills up the form). I want to be able to zoom in on my drawing so I tried the following code:

PanelDrawingArea->Scale->X = PanelDrawingArea->Scale->X / 1.1;
PanelDrawingArea->Scale->Y = PanelDrawingArea->Scale->Y / 1.1;

This is no good for 2 reasons. 1) The TPanel (PanelDrawingArea) does not stay aligned to it’s Form client as you can see from the picture below. 2) The relationship between pixel distance on the Form and the scaled TPanel is no longer 1:1 so when i drag my little rectangles around the mouse “pulls away” from them instead of staying right with them.

I’m open to better direction if TPanel is not a good place to build a drawing.

Comments are closed.