Skip to content

Commit

Permalink
Fixed Gum zoom bugs when increasing visible area
Browse files Browse the repository at this point in the history
fixes #1660
  • Loading branch information
vchelaru committed Dec 13, 2024
1 parent 0b26a62 commit 629b42c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ private static void GenerateSetGumResolutionValues(ICodeBlock codeblock)

//gumIfBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasHeight = FlatRedBall.Camera.Main.DestinationRectangle.Height / (Data.Scale / 100.0f);");
//gumIfBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasWidth = FlatRedBall.Camera.Main.DestinationRectangle.Width / (Data.Scale / 100.0f);");
gumIfIncreaseAreaBlock.Line("global::RenderingLibrary.SystemManagers.Default.Renderer.Camera.Zoom = Data.Scale/100.0f;");
gumIfIncreaseAreaBlock.Line("global::RenderingLibrary.SystemManagers.Default.Renderer.Camera.Zoom = Data.ScaleGum/100.0f * Data.Scale/100.0f;");

// Don't use DefaultCanvasWidth and DefaultCanvasHeight, that wouldn't be responding to size:
//gumIfIncreaseAreaBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasWidth = Gum.Managers.ObjectFinder.Self.GumProjectSave.DefaultCanvasWidth;");
//gumIfIncreaseAreaBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasHeight = Gum.Managers.ObjectFinder.Self.GumProjectSave.DefaultCanvasHeight; ");
gumIfIncreaseAreaBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasWidth = FlatRedBall.Camera.Main.DestinationRectangle.Width;");
gumIfIncreaseAreaBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasHeight = FlatRedBall.Camera.Main.DestinationRectangle.Height; ");
gumIfIncreaseAreaBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasWidth = " +
"FlatRedBall.Camera.Main.DestinationRectangle.Width / (Data.ScaleGum/100.0f * Data.Scale / 100.0f);");
gumIfIncreaseAreaBlock.Line("Gum.Wireframe.GraphicalUiElement.CanvasHeight = " +
"FlatRedBall.Camera.Main.DestinationRectangle.Height / (Data.ScaleGum/100.0f * Data.Scale / 100.0f); ");


var gumElseBlock = gumIfIncreaseAreaBlock.End().Else();
Expand Down

0 comments on commit 629b42c

Please sign in to comment.