Skip to content

Commit

Permalink
fix!: FixedResolutionViewport noClip -> clip (#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon authored May 11, 2022
1 parent f88200a commit 02be4ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/flame/lib/src/game/camera/viewport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class DefaultViewport extends Viewport {
class FixedResolutionViewport extends Viewport {
/// By default, this viewport will clip anything rendered outside.
/// Use this variable to control that behaviour.
bool noClip;
bool clip;

@override
late Vector2 effectiveSize;
Expand All @@ -148,7 +148,7 @@ class FixedResolutionViewport extends Viewport {
/// The Rect that is used to clip the canvas
late Rect _clipRect;

FixedResolutionViewport(this.effectiveSize, {this.noClip = false});
FixedResolutionViewport(this.effectiveSize, {this.clip = true});

@override
void resize(Vector2 newCanvasSize) {
Expand Down Expand Up @@ -176,7 +176,7 @@ class FixedResolutionViewport extends Viewport {

@override
void apply(Canvas c) {
if (!noClip) {
if (clip) {
c.clipRect(_clipRect);
}
c.transform(_transform.storage);
Expand Down

0 comments on commit 02be4ac

Please sign in to comment.