MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / insertRemove

Method insertRemove

radiantcore/patch/Patch.cpp:587–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587void Patch::insertRemove(bool insert, bool column, bool first)
588{
589 undoSave();
590
591 try
592 {
593 if (insert)
594 {
595 // Decide whether we should insert rows or columns
596 if (column) {
597 // The insert point is 1 for "beginning" and width-2 for "end"
598 insertColumns(first ? 1 : _width-2);
599 }
600 else {
601 // The insert point is 1 for "beginning" and height-2 for "end"
602 insertRows(first ? 1 : _height-2);
603 }
604 }
605 else {
606 // Col/Row Removal
607 if (column) {
608 // Column removal, pass TRUE
609 removePoints(true, first ? 2 : _width - 3);
610 }
611 else {
612 // Row removal, pass FALSE
613 removePoints(false, first ? 2 : _height - 3);
614 }
615 }
616 }
617 catch (const GenericPatchException& g) {
618 rError() << "Error manipulating patch dimensions: " << g.what() << "\n";
619 }
620
621 controlPointsChanged();
622}
623
624void Patch::appendPoints(bool columns, bool beginning) {
625 bool rows = !columns; // Shortcut for readability

Callers 8

insertPatchColumnsAtEndFunction · 0.80
insertPatchRowsAtEndFunction · 0.80
deletePatchRowsFromEndFunction · 0.80

Calls 2

rErrorFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected