Fix return reference to local temporary value (#1127)

* Fix invalid return type for temporary variable
This commit is contained in:
RH 2023-03-22 00:22:02 +11:00 committed by GitHub
parent 9720265ba6
commit 4c90ac17a4
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ void AnchoredSprite::setAnchorPoint(const Vec2& anchor)
updatePoly();
}
const Rect& AnchoredSprite::getTouchRect()
Rect AnchoredSprite::getTouchRect()
{
Size s = getContentSize();
Size a = _spriteVertexAnchor * s;

View File

@ -140,7 +140,7 @@ public:
/* This function will reposition the sprite's vertices itself instead of the node */
virtual void setAnchorPoint(const Vec2& anchor) override;
/* Gets the hit area of the anchored sprite, this requires special calculations for shifted vertices and should be used with touch event listeners */
virtual const Rect& getTouchRect();
virtual Rect getTouchRect();
protected:
virtual void setVertexCoords(const Rect& rect, V3F_C4B_T2F_Quad* outQuad) override;