Added duplicate selection (CTRL+D), undo and redo (CTRL+Z/Y) with scene history. - #133
ReubenJCarter wants to merge 53 commits into
Conversation
…odes as the performance was bad. Added OpenGL rendering for flow view.
…hat have no endpoint on selection
… data model to nodes when duplicating
|
My laptop is in repair and I was busy with our small baby last weeks. Thanks |
… performance benefits
# Conflicts: # src/FlowView.cpp # src/FlowView.hpp
Daguerreo
left a comment
There was a problem hiding this comment.
Indenting is not consistent with the project. Copy and Pasting a node from a scene to another should not throw in case the node is not registered in second scene but just not performing the operation.
| virtual | ||
| NodePainterDelegate* painterDelegate() const { return nullptr; } | ||
|
|
||
| QString toolTipText(); |
There was a problem hiding this comment.
Should be const and inline as other getters
| } | ||
|
|
||
|
|
||
| void NodeDataModel::setToolTipText(QString text) |
|
|
||
| Node&restoreNode(QJsonObject const& nodeJson); | ||
|
|
||
| QUuid pasteNode(QJsonObject &json); |
| _scene->UpdateHistory(); | ||
| } | ||
|
|
||
| void FlowView::duplicateSelectedNode() |
There was a problem hiding this comment.
a lot of implicit conversion warning float-double
|
|
||
| //create nodes | ||
| std::vector<Node*> createdNodes; | ||
| std::vector<Node*> couterpartNode; |
|
|
||
| void FlowScene::pasteConnection(QJsonObject const &connectionJson, QUuid newIn, QUuid newOut) | ||
| { | ||
| QUuid nodeInId = QUuid(connectionJson["in_id"].toString()); |
| if(j >=0 && k>=0 && j < couterpartNode.size() && k < couterpartNode.size()) | ||
| { | ||
| auto connection = _scene->createConnection(*createdNodes[j], portIndexIn, *createdNodes[k], portIndexOut); | ||
| auto& connectionRef = connection; |
|
This pull request has a plenty of unrelated features. Nevertheless, I took some coding samples from this work and implemented an Undo/Redo system and a Ctrl+D node duplication mechanism. I'll continlue looking through the code to take more features for master |
Added logic to avoid saving duplicate connections when serializing the scene and when exporting selected nodes and connections. This ensures that each connection is only included once in the resulting JSON, improving data integrity and preventing redundant entries.
contextMenuEvent was an empty stub, so a group's colour could only be set by editing the saved JSON. The colour is stored in r/g/b, which Group::save() already writes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
FlowView::setNavigation(blender, trackpadScroll), default Blender + trackpad: middle-drag or Alt+left-drag pans, Ctrl+that zooms, left-drag on empty space box-selects, Home frames all nodes; trackpad scroll pans and Ctrl+scroll (pinch) zooms at the cursor, or the wheel zooms in mouse mode. blender=false keeps the original left-drag pan / wheel step zoom. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…p under the mouse Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Drawing mode: auto (software over Remote Desktop, where OpenGL falls back to slow software GL), OpenGL, or software; software repaints only what changed. - Low detail below 40% zoom: embedded widgets hidden. - Anti-aliasing off while panning/zooming, back on 150 ms after. - Optional frame-time overlay to measure (ms/frame, mode, node count). - Group collapse button: hamburger icon, always top-left; name keeps clear. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Zoom no longer scales with the trackpad pan speed and each step is capped at one notch (1.1x at zoom speed 1), so coarse Ctrl+scroll/pinch steps over RDP don't jump. Pan speed default 4. The frame-time overlay also shows the last raw wheel event (angle/pixel delta, modifier) to tune against. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Zoom felt slow/jumpy: every step jumped to the new scale and forced every visible node to re-render its DeviceCoordinateCache at the new zoom level. Wheel/pinch zoom now accumulates a target (1.2x per notch at zoom speed 1, at most ~3 notches queued) and eases towards it at 60 fps; while zooming, nodes use ItemCoordinateCache (scaled pixmap) and return to the crisp device cache 150 ms after the last step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Groups: colour/collapse menu, Blender-style navigation, faster drawing
No description provided.