CFrame::setZoom() on iOS

A User Interface Toolkit mainly for Audio Plug-Ins (VST, AudioUnit, etc).
ray
Posts: 18
Joined: Fri Sep 02, 2016 9:37 am

CFrame::setZoom() on iOS

Postby ray » Mon May 29, 2017 3:20 pm

Hi,

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 uiviewframe.mm. And in fact, applying the inverse transform to the touch location in updateTouchEvent: in VSTGUI_UIView seems to fix the described issue:

Code: Select all


uiviewframe.mm

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

...

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


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?

Thanks!

Arne Scheffler
Posts: 122
Joined: Mon Jun 20, 2016 7:53 am

Re: CFrame::setZoom() on iOS

Postby Arne Scheffler » Tue May 30, 2017 7:50 am

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 uiviewframe.mm.

Cheers
Arne

ray
Posts: 18
Joined: Fri Sep 02, 2016 9:37 am

Re: CFrame::setZoom() on iOS

Postby ray » Tue May 30, 2017 7:44 pm

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.

Best,
Ray


Return to “VSTGUI”

Who is online

Users browsing this forum: No registered users and 4 guests