|
@@ -100,6 +100,7 @@ export class TextureCanvasManager {
|
|
private static MAX_SCALE : number = 10;
|
|
private static MAX_SCALE : number = 10;
|
|
|
|
|
|
private static SELECT_ALL_KEY = 'KeyA';
|
|
private static SELECT_ALL_KEY = 'KeyA';
|
|
|
|
+ private static SAVE_KEY ='KeyS';
|
|
private static DESELECT_KEY = 'Escape'
|
|
private static DESELECT_KEY = 'Escape'
|
|
|
|
|
|
private _tool : Nullable<ITool>;
|
|
private _tool : Nullable<ITool>;
|
|
@@ -210,6 +211,10 @@ export class TextureCanvasManager {
|
|
});
|
|
});
|
|
evt.preventDefault();
|
|
evt.preventDefault();
|
|
}
|
|
}
|
|
|
|
+ if (evt.code === TextureCanvasManager.SAVE_KEY && evt.ctrlKey) {
|
|
|
|
+ this.saveTexture();
|
|
|
|
+ evt.preventDefault();
|
|
|
|
+ }
|
|
if (evt.code === TextureCanvasManager.DESELECT_KEY) {
|
|
if (evt.code === TextureCanvasManager.DESELECT_KEY) {
|
|
this._setMetadata({
|
|
this._setMetadata({
|
|
select: {
|
|
select: {
|
|
@@ -641,6 +646,13 @@ export class TextureCanvasManager {
|
|
}, undefined, true);
|
|
}, undefined, true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public saveTexture() {
|
|
|
|
+ const canvas = this._editing3D ? this._3DCanvas : this._2DCanvas;
|
|
|
|
+ Tools.ToBlob(canvas, (blob) => {
|
|
|
|
+ Tools.Download(blob!, this._originalTexture.name);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
public dispose() {
|
|
public dispose() {
|
|
if (this._didEdit) {
|
|
if (this._didEdit) {
|
|
this._originalInternalTexture?.dispose();
|
|
this._originalInternalTexture?.dispose();
|