mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 10:20:48 +00:00
Fix crash Ctrl+clicking an ill-formed reference layer cel with width/height < 1.0
The width/height of a reference layer cel cannot be < 1.0, but in the extreme case where this happens, Ctrl+clicking the reference layer shouldn't crash the program.
This commit is contained in:
parent
571134c1b4
commit
52b1899e9d
@ -43,6 +43,8 @@ namespace doc {
|
||||
}
|
||||
|
||||
void setBounds(const gfx::Rect& bounds) {
|
||||
ASSERT(bounds.w > 0);
|
||||
ASSERT(bounds.h > 0);
|
||||
m_bounds = bounds;
|
||||
if (m_boundsF)
|
||||
*m_boundsF = gfx::RectF(bounds);
|
||||
@ -55,6 +57,8 @@ namespace doc {
|
||||
m_boundsF = std::make_unique<gfx::RectF>(boundsF);
|
||||
|
||||
m_bounds = gfx::Rect(boundsF);
|
||||
if (m_bounds.w <= 0) m_bounds.w = 1;
|
||||
if (m_bounds.h <= 0) m_bounds.h = 1;
|
||||
}
|
||||
|
||||
const gfx::RectF& boundsF() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user