CFrame::setZoom() on iOS


calling CFrame::setZoom() on iOS yields the correct scaling of my frame’s content. However, the touch event handling always seems to respect the original coordinate system, i.e. controls still react to their original bounding boxes present before the setZoom() call.

I haven’t analyzed the problem in depth, but everything works as expected on Mac OS and Windows targets, so I suspect the bug is located in CFrame::platformOnTouchEvent() or the calling code in And in fact, applying the inverse transform to the touch location in updateTouchEvent: in VSTGUI_UIView seems to fix the described issue:

- (void)updateTouchEvent:(NSSet*)touches
auto ctm = ((CFrame*) uiViewFrame->getFrame())->getTransform().inverse()
iTouch->second.location = CPointFromCGPoint ([touch locationInView:self]);


t.location = CPointFromCGPoint ([touch locationInView:self]);

But of course, this should be considered anything but a clean fix.

The goal is to scale an existing desktop implementation of my editor to fit a given iOS device’s display using CFrame::setZoom(). Any hints on what would be an alternative or the goto approach?


Hi Ray,
setZoom was not yet tested on iOS and I think the correct approach would be to apply the transform in CFrame::platformOnTouchEvent and not in


Thanks for clearing that up, Arne, that’s what I expected. Patching CFrame / CViewContainer in order to adjust the event location is a little more involved. I’ll try to make it into a pull-request as I have a couple of other bug fix suggestions.