Skip to content

Commit

Permalink
IDE-184 Fix Stitching Trace vanishing with MAXIMIZED screen (Catrobat…
Browse files Browse the repository at this point in the history
…#4850)

Problem was: Screenshotheight/width was not properly initialized in
all cases. - This caused the projection matrix to be 0, thus causing
the stitching patterns to disappear.

Moved initialization out of the switch s.t. it occurs in all cases.

Co-authored-by: Max Oberaigner <contact+catrobat@oberaigner.info>
  • Loading branch information
2 people authored and jANI0x committed Aug 25, 2023
1 parent 193f6c9 commit 0cf9540
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2023 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -727,10 +727,11 @@ public void clearBackground() {
}

private void initScreenMode() {
screenshotWidth = ScreenValues.getScreenWidthForProject(project);
screenshotHeight = ScreenValues.getScreenHeightForProject(project);

switch (project.getScreenMode()) {
case STRETCH:
screenshotWidth = ScreenValues.getScreenWidthForProject(project);
screenshotHeight = ScreenValues.getScreenHeightForProject(project);
screenshotX = 0;
screenshotY = 0;
viewPort = new ScalingViewport(Scaling.stretch, virtualWidth, virtualHeight, camera);
Expand Down

0 comments on commit 0cf9540

Please sign in to comment.