Skip to content

Commit

Permalink
Empty Path/Polygon/Polyline Check.
Browse files Browse the repository at this point in the history
  • Loading branch information
redteam316 committed Mar 8, 2014
1 parent 1ba1aec commit d41571e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions embroidermodder2/view.cpp
Expand Up @@ -256,12 +256,23 @@ void View::clearRubberRoom()
BaseObject* base = static_cast<BaseObject*>(item);
if(base)
{
if((base->type() == OBJ_TYPE_PATH && spareRubberList.contains(SPARE_RUBBER_PATH)) ||
(base->type() == OBJ_TYPE_POLYGON && spareRubberList.contains(SPARE_RUBBER_POLYGON)) ||
(base->type() == OBJ_TYPE_POLYLINE && spareRubberList.contains(SPARE_RUBBER_POLYLINE)) ||
int type = base->type();
if((type == OBJ_TYPE_PATH && spareRubberList.contains(SPARE_RUBBER_PATH)) ||
(type == OBJ_TYPE_POLYGON && spareRubberList.contains(SPARE_RUBBER_POLYGON)) ||
(type == OBJ_TYPE_POLYLINE && spareRubberList.contains(SPARE_RUBBER_POLYLINE)) ||
(spareRubberList.contains(base->objectID())))
{
vulcanizeObject(base);
if(!base->objectPath().elementCount())
{
QMessageBox::critical(this, tr("Empty Rubber Object Error"),
tr("The rubber object added contains no points. "
"The command that created this object has flawed logic. "
"The object will be deleted."));
gscene->removeItem(item);
delete item;
}
else
vulcanizeObject(base);
}
else
{
Expand Down

0 comments on commit d41571e

Please sign in to comment.