Browse Source

Merge pull request #40 from sstiller/fix-segfault

Fix return of reference to temporary
Peter Robinson 3 years ago
parent
commit
0acaf9fbbc
2 changed files with 2 additions and 2 deletions
  1. 1 1
      engine/source/2d/gui/guiSpriteCtrl.cc
  2. 1 1
      engine/source/2d/gui/guiSpriteCtrl.h

+ 1 - 1
engine/source/2d/gui/guiSpriteCtrl.cc

@@ -321,7 +321,7 @@ F32 GuiSpriteCtrl::getAspectRatio()
 	return 1.0;
 	return 1.0;
 }
 }
 
 
-Point2I& GuiSpriteCtrl::applyAlignment(RectI &bounds, Point2I &size)
+Point2I GuiSpriteCtrl::applyAlignment(RectI &bounds, Point2I &size)
 {
 {
 	Point2I offset = Point2I(0, 0);
 	Point2I offset = Point2I(0, 0);
 
 

+ 1 - 1
engine/source/2d/gui/guiSpriteCtrl.h

@@ -77,7 +77,7 @@ public:
 	Point2I constrainLockX(Point2I &point);
 	Point2I constrainLockX(Point2I &point);
 	Point2I constrainLockY(Point2I &point);
 	Point2I constrainLockY(Point2I &point);
 	F32 getAspectRatio();
 	F32 getAspectRatio();
-	Point2I& applyAlignment(RectI &bounds, Point2I &size);
+	Point2I applyAlignment(RectI &bounds, Point2I &size);
 
 
 	//Animation Functions
 	//Animation Functions
 	void moveTo(S32 x, S32 y, S32 time, EasingFunction ease = Linear);
 	void moveTo(S32 x, S32 y, S32 time, EasingFunction ease = Linear);