-
Notifications
You must be signed in to change notification settings - Fork 26
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
Screenshot for 3D view #5324
Merged
Merged
Screenshot for 3D view #5324
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9e9d8e3
also screenshot 3d view
daniel-wer 0014ce0
avoid artifacts for screenshots near the dataset border
daniel-wer a7815a8
allow screenshots in view mode
daniel-wer 88a9cfd
update changelog
daniel-wer 2efa7f9
Merge branch 'master' of github.com:scalableminds/webknossos into scr…
daniel-wer 110769f
set alpha value to 1 for out of bounding box parts, fixing the mirror…
daniel-wer ecbc264
Merge branch 'master' into screenshot-3d-view
daniel-wer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
// @flow | ||
import React, { useState, type Node } from "react"; | ||
import { Dropdown, Menu } from "antd"; | ||
import { ShareAltOutlined, DownOutlined } from "@ant-design/icons"; | ||
import { ShareAltOutlined, DownOutlined, CameraOutlined } from "@ant-design/icons"; | ||
import ButtonComponent from "oxalis/view/components/button_component"; | ||
import ShareViewDatasetModalView from "oxalis/view/action-bar/share_view_dataset_modal_view"; | ||
import { downloadScreenshot } from "oxalis/view/rendering_utils"; | ||
|
||
type Props = { | ||
layoutMenu: Node, | ||
}; | ||
|
||
export const screenshotMenuItem = ( | ||
<Menu.Item key="screenshot-button" onClick={downloadScreenshot}> | ||
<CameraOutlined /> | ||
Screenshot (Q) | ||
</Menu.Item> | ||
); | ||
|
||
export default function ViewDatasetActionsView(props: Props) { | ||
const [shareDatasetModalVisibility, setShareDatasetModalVisibility] = useState(false); | ||
const modal = ( | ||
|
@@ -19,11 +27,12 @@ export default function ViewDatasetActionsView(props: Props) { | |
); | ||
const overlayMenu = ( | ||
<Menu> | ||
{props.layoutMenu} | ||
<Menu.Item key="share-button" onClick={() => setShareDatasetModalVisibility(true)}> | ||
<ShareAltOutlined /> | ||
Share | ||
</Menu.Item> | ||
{screenshotMenuItem} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice addition 👍 |
||
{props.layoutMenu} | ||
</Menu> | ||
); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@philippotto Setting the alpha value to 1 for pixels outside of the bounding box, fixes both the mirroring issue (described in the PR description - would make my earlier fix obsolete) as well as the other transparency issue (see Michaels screenshot). Do you see any harm in that? I checked that the node picking is not affected.
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.
Sounds perfectly fine to me 👍 I don't think that a lot of reasoning went into this line when it was written. The result probably behaved like "black" in the critical use case (viewport is out of bounds) which was considered good enough. Cool that you found this solution :)
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.
I can't find any case where it would result in a 🐛 too.