-
Notifications
You must be signed in to change notification settings - Fork 385
Graph Editor : Add snapshot capability #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add in save dialog and help. - Ad in CTRL-I vs CTRL-SHIFT-I to capture editor or whole window.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lfl-eholthouser : I've added this as a new snapshot utility. Have a look when you have time and let me know what you think. Thanks.
@@ -326,6 +332,14 @@ class Graph | |||
|
|||
// Options | |||
bool _saveNodePositions; | |||
|
|||
// Panel information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make class members to track panel placement / size changes.
Also pull out constant 15 indent to avoid hard-coded numbers.
@@ -4031,6 +4072,65 @@ void Graph::handleRenderViewInputs() | |||
} | |||
} | |||
|
|||
mx::ImagePtr Graph::performSnapshot(bool captureWindow) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snapshot function : takes into account the current splitter layout and extra formatting (indentation).
static float leftPaneWidth = 375.0f; | ||
static float rightPaneWidth = 750.0f; | ||
splitter(true, 4.0f, &leftPaneWidth, &rightPaneWidth, 20.0f, 20.0f); | ||
splitter(true, 4.0f, &_leftPaneWidth, &_rightPaneWidth, 20.0f, 20.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove some hard-coded statics and make class members for reuse during snapshot.
@@ -3180,6 +3185,40 @@ void Graph::saveGraphToFile() | |||
_fileDialogSave.open(); | |||
} | |||
|
|||
void Graph::showSnapshotDialog() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some file dialog infrastructure. Save uses the current captured image.
Changes
Fixes issue #2429
Add in "snapshot" capability for node editor panel.
Interface Changes
New Keys
CTRL-I
: capture the editor panelCTRL-SHIFT-I
: capture the entire windowHelp Dialog Update
Each option will bring up file dialog to allow user to input file name to save. Defaults to PNG extension.
Examples: