From 78f24f56b065950738a0d6381c4c9cdd844aa406 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 10 Jul 2023 21:19:37 +0800 Subject: [PATCH] add export function --- index.html | 2 +- public/favicon.png | Bin 0 -> 922 bytes src/components/uiControls/bottom/SaveButton.ts | 5 ++++- src/models/reducer.ts | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 public/favicon.png diff --git a/index.html b/index.html index 3d5a2b3..4fc17cf 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Pixel Editor diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..600d3d6ac51ae2d1cc7e929a194fa923d826cf55 GIT binary patch literal 922 zcmV;L17-Y)P)Px&R7pfZRCr$Pnmtk+K@5c<#6?0#l~3RZ4&sw=9-oAR;K(O%6(I=);ktUf+R|v$ z-A^s4mt`Siclzgj{q)lVmltRLbLr84|NCag$3NY@xaRZhWpu1-!xF$L!bk()gi)O3 z+8gQ!_aZG9$W0hR6z0Z9RXx?m3>eJ`zC@C5+Llq1g=!(dw3lUmXoPzwW!djj-y z_wqSIz~GvrCBU>YXb@i>Ju3jK>oW){HB3_{7XlaYf3JV8KK}mtxcn|ZFQ3tO`vEC? zO_@|VSyen2sR5vQ7>MxwhEHe_j{*>G2;Fn&WLEJO09g<+0aR_zLA7##mL#LYAq&7t z{I@^97AB!kek?LMW&qg9gcc1zBuAG9*Wi(u53#_0l8A7K1aPoDoj8e&vVKNR zhybujb~6EZtAiJSn&~-!*6BZA?JjQLy<7P2i_viKtiG|l)#{M|Mj?y>P|F-z>WXms ziE_YbWf%ca6<-6u1@lA}Eq=rWLjY=ZUILgYTK>=FaDLwQa*sFP6TA6-Q(4uAnqAFGNEQ&j7G;1JXf` widFelt("canvas"); + let canvas = elt("canvas", { + width: this.picture.width, + height: this.picture.height, + }); drawPicture(this.picture, canvas, 1); let link = elt("a", { href: canvas.toDataURL(), diff --git a/src/models/reducer.ts b/src/models/reducer.ts index 986b65d..4b8fb09 100644 --- a/src/models/reducer.ts +++ b/src/models/reducer.ts @@ -25,6 +25,7 @@ export function reducer(state: EditorState, action: ActionObj) { doneAt: Date.now(), }); } else if (action.type == "select-color") { + // console.log("select color", action); const newColor = action.payload!.color; return Object.assign({}, state, { color: newColor,