# HG changeset patch # User Santeri Piippo # Date 1373228237 -10800 # Node ID 77f08db90249477d13e2c7d8162bebc95f044faf # Parent bcdfc801658b08f8472a116aa84b789c4626e0d8 when inlining (as an action), reinterpret the inlinees so that there's not any pointer mess-ups diff -r bcdfc801658b -r 77f08db90249 src/gui.cpp --- a/src/gui.cpp Sun Jul 07 17:45:48 2013 +0300 +++ b/src/gui.cpp Sun Jul 07 23:17:17 2013 +0300 @@ -820,6 +820,9 @@ m_objList->clearSelection (); for (LDObject* obj : m_sel) { + if( obj->qObjListEntry == null ) + continue; + obj->qObjListEntry->setSelected (true); obj->setSelected (true); } @@ -1175,6 +1178,11 @@ g_actionMeta[g_metacursor++] = meta; } +void ForgeWindow::clearSelection() +{ + m_sel.clear(); +} + QImage imageFromScreencap (uchar* data, ushort w, ushort h) { // GL and Qt formats have R and B swapped. Also, GL flips Y - correct it as well. return QImage (data, w, h, QImage::Format_ARGB32).rgbSwapped ().mirrored (); diff -r bcdfc801658b -r 77f08db90249 src/gui.h --- a/src/gui.h Sun Jul 07 17:45:48 2013 +0300 +++ b/src/gui.h Sun Jul 07 23:17:17 2013 +0300 @@ -138,6 +138,7 @@ void primitiveLoaderStart (ulong max); void primitiveLoaderUpdate (ulong prog); void primitiveLoaderEnd (); + void clearSelection(); protected: void closeEvent (QCloseEvent* ev); diff -r bcdfc801658b -r 77f08db90249 src/gui_editactions.cpp --- a/src/gui_editactions.cpp Sun Jul 07 17:45:48 2013 +0300 +++ b/src/gui_editactions.cpp Sun Jul 07 23:17:17 2013 +0300 @@ -127,13 +127,16 @@ // Merge in the inlined objects for (LDObject* inlineobj : objs) { - // This object is now inlined so it has no parent anymore. - inlineobj->setParent (null); - g_curfile->insertObj (idx++, inlineobj); + str line = inlineobj->raw(); + delete inlineobj; + + LDObject* newobj = parseLine( line ); + g_curfile->insertObj( idx++, newobj ); + g_win->sel() << newobj; } // Delete the subfile now as it's been inlined. - g_curfile->forgetObject (obj); + g_curfile->forgetObject( obj ); delete obj; } diff -r bcdfc801658b -r 77f08db90249 src/ui/ytruder.ui --- a/src/ui/ytruder.ui Sun Jul 07 17:45:48 2013 +0300 +++ b/src/ui/ytruder.ui Sun Jul 07 23:17:17 2013 +0300 @@ -118,6 +118,9 @@ 3 + + -10000.000000000000000 + 10000.000000000000000