313 if (document()) |
313 if (document()) |
314 document()->forgetObject(this); |
314 document()->forgetObject(this); |
315 |
315 |
316 // Delete the GL lists |
316 // Delete the GL lists |
317 if (g_win) |
317 if (g_win) |
318 g_win->renderer()->forgetObject(this); |
318 g_win->currentRenderer()->forgetObject(this); |
319 |
319 |
320 // Remove this object from the list of LDObjects |
320 // Remove this object from the list of LDObjects |
321 g_allObjects.erase(g_allObjects.find(id())); |
321 g_allObjects.erase(g_allObjects.find(id())); |
322 m_isDestroyed = true; |
322 m_isDestroyed = true; |
323 delete this; |
323 delete this; |
479 removeDuplicates(objsToCompile); |
479 removeDuplicates(objsToCompile); |
480 |
480 |
481 // The objects need to be recompiled, otherwise their pick lists are left with |
481 // The objects need to be recompiled, otherwise their pick lists are left with |
482 // the wrong index colors which messes up selection. |
482 // the wrong index colors which messes up selection. |
483 for (LDObject* obj : objsToCompile) |
483 for (LDObject* obj : objsToCompile) |
484 g_win->renderer()->compileObject(obj); |
484 g_win->currentRenderer()->compileObject(obj); |
485 } |
485 } |
486 |
486 |
487 // ============================================================================= |
487 // ============================================================================= |
488 // |
488 // |
489 // Get type name by enumerator |
489 // Get type name by enumerator |
846 QString after = obj->asText(); |
846 QString after = obj->asText(); |
847 |
847 |
848 if (before != after) |
848 if (before != after) |
849 { |
849 { |
850 obj->document()->addToHistory(new EditHistoryEntry(idx, before, after)); |
850 obj->document()->addToHistory(new EditHistoryEntry(idx, before, after)); |
851 g_win->renderer()->compileObject(obj); |
851 g_win->currentRenderer()->compileObject(obj); |
852 g_win->currentDocument()->redoVertices(); |
852 g_win->currentDocument()->redoVertices(); |
853 } |
853 } |
854 } |
854 } |
855 else |
855 else |
856 { |
856 { |