quick hacky fix for save vis/vis to res
This commit is contained in:
parent
04a3cfdb71
commit
a0e7608d06
2 changed files with 31 additions and 7 deletions
|
@ -441,7 +441,7 @@
|
||||||
src="js/ui/tool/colorbrush.js?v=46011ee"
|
src="js/ui/tool/colorbrush.js?v=46011ee"
|
||||||
type="text/javascript"></script>
|
type="text/javascript"></script>
|
||||||
<script
|
<script
|
||||||
src="js/ui/tool/select.js?v=63fe672"
|
src="js/ui/tool/select.js?v=39911b2"
|
||||||
type="text/javascript"></script>
|
type="text/javascript"></script>
|
||||||
<script src="js/ui/tool/stamp.js?v=d89b15d" type="text/javascript"></script>
|
<script src="js/ui/tool/stamp.js?v=d89b15d" type="text/javascript"></script>
|
||||||
<script
|
<script
|
||||||
|
|
|
@ -735,9 +735,21 @@ const selectTransformTool = () =>
|
||||||
saveVisibleSelectionButton.textContent = "Save Vis.";
|
saveVisibleSelectionButton.textContent = "Save Vis.";
|
||||||
saveVisibleSelectionButton.title = "Saves Visible Selection";
|
saveVisibleSelectionButton.title = "Saves Visible Selection";
|
||||||
saveVisibleSelectionButton.onclick = () => {
|
saveVisibleSelectionButton.onclick = () => {
|
||||||
const canvas = uil.getVisible(state.selected, {
|
const canvas = uil.getVisible(
|
||||||
categories: ["image", "user", "select-display"],
|
{
|
||||||
});
|
x:
|
||||||
|
state._selected._position.x -
|
||||||
|
state._selected.canvas.width / 2,
|
||||||
|
y:
|
||||||
|
state._selected._position.y -
|
||||||
|
state._selected.canvas.height / 2,
|
||||||
|
w: state._selected.canvas.width,
|
||||||
|
h: state._selected.canvas.height,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
categories: ["image", "user", "select-display"],
|
||||||
|
}
|
||||||
|
);
|
||||||
downloadCanvas({
|
downloadCanvas({
|
||||||
cropToContent: false,
|
cropToContent: false,
|
||||||
canvas,
|
canvas,
|
||||||
|
@ -751,9 +763,21 @@ const selectTransformTool = () =>
|
||||||
createVisibleResourceButton.title =
|
createVisibleResourceButton.title =
|
||||||
"Saves Visible Selection as a Resource";
|
"Saves Visible Selection as a Resource";
|
||||||
createVisibleResourceButton.onclick = () => {
|
createVisibleResourceButton.onclick = () => {
|
||||||
const canvas = uil.getVisible(state.selected, {
|
const canvas = uil.getVisible(
|
||||||
categories: ["image", "user", "select-display"],
|
{
|
||||||
});
|
x:
|
||||||
|
state._selected._position.x -
|
||||||
|
state._selected.canvas.width / 2,
|
||||||
|
y:
|
||||||
|
state._selected._position.y -
|
||||||
|
state._selected.canvas.height / 2,
|
||||||
|
w: state._selected.canvas.width,
|
||||||
|
h: state._selected.canvas.height,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
categories: ["image", "user", "select-display"],
|
||||||
|
}
|
||||||
|
);
|
||||||
const image = document.createElement("img");
|
const image = document.createElement("img");
|
||||||
image.src = canvas.toDataURL();
|
image.src = canvas.toDataURL();
|
||||||
image.onload = () => {
|
image.onload = () => {
|
||||||
|
|
Loading…
Reference in a new issue