From f3b3f21d3ba0fd48bc265684817cb38a70adf84b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 25 Dec 2008 07:53:09 -0500 Subject: Bounds errors are verbose now and some unchecked conditions fixed as well --- sigmod/MapWarp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sigmod/MapWarp.cpp') diff --git a/sigmod/MapWarp.cpp b/sigmod/MapWarp.cpp index e0482f14..137c5f98 100644 --- a/sigmod/MapWarp.cpp +++ b/sigmod/MapWarp.cpp @@ -98,9 +98,9 @@ void Sigmod::MapWarp::setArea(const QRect& area) { const Map* map = qobject_cast(parent()); if ((map->width() <= area.x()) || (map->height() <= area.y())) - emit(error(bounds("area"))); - else if ((area.width() <= 0) || (area.height() <= 0)) - emit(error(bounds("area"))); + emit(error(bounds("area", QPoint(0, 0), QPoint(map->width(), map->height()), area.topLeft()))); + else if ((area.width() <= 0) || (area.height() <= 0) || ((map->width() - area.x()) < area.width()) || ((map->height() - area.y()) < area.height())) + emit(error(bounds("area size", QPoint(0, 0), QPoint(map->width() - area.x(), map->height() - area.y()), area.translated(-area.topLeft()).bottomRight()))); else CHECK(area); } @@ -113,7 +113,7 @@ void Sigmod::MapWarp::setType(const Type type) void Sigmod::MapWarp::setToMap(const int toMap) { if (!sigmod()->mapById(toMap)) - emit(error(bounds("toMap"))); + emit(error(bounds("toMap", toMap))); else CHECK(toMap); } @@ -122,9 +122,9 @@ void Sigmod::MapWarp::setToWarp(const int toWarp) { const Map* map = sigmod()->mapById(m_toMap); if (!map) - emit(error(bounds("toMap"))); + emit(error(bounds("toMap", m_toMap))); else if (!map->warpById(toWarp)) - emit(error(bounds("toWarp"))); + emit(error(bounds("toWarp", toWarp))); else CHECK(toWarp); } -- cgit