Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Jan 7, 2025
1 parent d0183ca commit 2a0656e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
24 changes: 0 additions & 24 deletions Source/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,30 +312,6 @@ void Connection::renderConnectionOrder(NVGcontext* nvg)
}
}

void Connection::setPathStateDirectly()
{
if (!inlet || !outlet)
return;

t_symbol* newPathState;
if (segmented) {
MemoryOutputStream stream;

for (auto const& point : currentPlan) {
stream.writeInt(point.x - outlet->getCanvasBounds().getCentre().x);
stream.writeInt(point.y - outlet->getCanvasBounds().getCentre().y);
}
auto const base64 = stream.getMemoryBlock().toBase64Encoding();
newPathState = cnv->pd->generateSymbol(base64);
} else {
newPathState = cnv->pd->generateSymbol("empty");
}

if (auto oc = ptr.get<t_outconnect>()) {
outconnect_set_path_data(oc.get(), newPathState);
}
}

void Connection::pushPathState(bool force)
{
if (!inlet || !outlet)
Expand Down
1 change: 0 additions & 1 deletion Source/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Connection final : public DrawablePath

t_symbol* getPathState() const;
void pushPathState(bool force = false);
void setPathStateDirectly();

void popPathState();

Expand Down
6 changes: 1 addition & 5 deletions Source/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,17 +845,13 @@ void Object::mouseUp(MouseEvent const& e)
obj->isObjectMouseActive = false;

if (ds.wasResized) {

cnv->objectGrid.clearIndicators(false);
for(auto* connection : getConnections())
connection->pushPathState(true);

applyBounds();
cnv->patch.endUndoSequence("Resize");

for(auto* connection : getConnections())
connection->setPathStateDirectly();


ds.wasResized = false;
originalBounds.setBounds(0, 0, 0, 0);
} else {
Expand Down

0 comments on commit 2a0656e

Please sign in to comment.