Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waveshaper tearout scaling is borked #6635

Closed
Andreya-Autumn opened this issue Sep 29, 2022 · 3 comments · Fixed by #6660
Closed

Waveshaper tearout scaling is borked #6635

Andreya-Autumn opened this issue Sep 29, 2022 · 3 comments · Fixed by #6660
Labels
Bug Report Item submitted using the Bug Report template UI Issues related to UI look&feel

Comments

@Andreya-Autumn
Copy link
Collaborator

It's fine as long as it stays inside, but torn out it looks like this:

Waveshaper

@Andreya-Autumn Andreya-Autumn added UI Issues related to UI look&feel Bug Report Item submitted using the Bug Report template labels Sep 29, 2022
@mkruselj mkruselj added this to the Surge XT 1.1.2 milestone Sep 29, 2022
@baconpaul
Copy link
Collaborator

baconpaul commented Sep 30, 2022

oh that's the annoying scale-on-resize thing that tearouts need. I know the fix. easy to do for 1.1.2. thanks!

@baconpaul
Copy link
Collaborator

The reason for this is that the window when torn out doesn't quite inherit the parent transform

The fix for this is in the ::resized method to compensate the width and height.

You can see FilterAnalysis::resized does

void FilterAnalysis::resized()
{
    auto t = getTransform().inverted();
    auto h = getHeight();
    auto w = getWidth();
    t.transformPoint(w, h);

    f1Button->setBounds(2, 2, 40, 15);
    f2Button->setBounds(w - 42, 2, 40, 15);

    catchUpStore = evaluator->outboundUpdates - 1; // because we need to rebuild the path
}

whereas WaveShaperAnalysis::resized does

void WaveShaperAnalysis::resized() {}

so basically take that transform of w and h and use it in the resized method is the answer. Make WaveShaper look like Filter.

@baconpaul
Copy link
Collaborator

baconpaul commented Oct 7, 2022

Oh the other trick is in the Filter paint method we don't use getLocalBounds but we use a transformed local bounds

So look in FilterAnalysis::paint and you see

    auto lb = getLocalBounds().transformedBy(getTransform().inverted());
    auto dRect = lb.withTrimmedTop(15).reduced(4);
    auto width = dRect.getWidth();
    auto height = dRect.getHeight();
    

will have to do same in waveshaper paint (and that's probably the real fix since waveshaper doesn't currently have any subcomponents to resize)

@mkruselj mkruselj changed the title Waveshaper tearout scaling is borked. Waveshaper tearout scaling is borked Oct 15, 2022
baconpaul added a commit to baconpaul/surge that referenced this issue Oct 22, 2022
Waveshaper tearout needed transform-dop correction to allow it
to draw int he right space.

Closes surge-synthesizer#6635
baconpaul added a commit that referenced this issue Oct 22, 2022
Waveshaper tearout needed transform-dop correction to allow it
to draw int he right space.

Closes #6635
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template UI Issues related to UI look&feel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants