From 219837602610c366f2ff9b76e291be8211fd6a5e Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 12 Mar 2024 10:10:53 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=ED=8E=B8=EC=A7=91?= =?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95(=EC=99=BC=EC=AA=BD=20=ED=9A=8C?= =?UTF-8?q?=EC=A0=84,=EC=98=A4=EB=A5=B8=EC=AA=BD=20=ED=9A=8C=EC=A0=84=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/fims/biz/paintweb/guiScript.js | 13 +- .../resources/lib/fims/biz/paintweb/korean.js | 5 +- .../resources/lib/fims/biz/paintweb/layout.js | 216 ++---------------- .../lib/fims/biz/paintweb/paintweb.js | 84 ++++--- .../lib/fims/biz/paintweb/style/style.css | 2 - 5 files changed, 85 insertions(+), 235 deletions(-) diff --git a/src/main/webapp/resources/lib/fims/biz/paintweb/guiScript.js b/src/main/webapp/resources/lib/fims/biz/paintweb/guiScript.js index c61557d6..f2631e5f 100644 --- a/src/main/webapp/resources/lib/fims/biz/paintweb/guiScript.js +++ b/src/main/webapp/resources/lib/fims/biz/paintweb/guiScript.js @@ -1419,7 +1419,18 @@ pwlib.gui = function (app) { button.classList.add('btn'); button.classList.add('btn-outline-dark'); button.classList.add('p-1'); - button.appendChild(doc.createTextNode(button.title)); + button.classList.add('w-px-100'); + + if(button.title.indexOf(" [") != -1){ + var i = button.title.indexOf(" ["); + var str1 = button.title.substr(0,i); + var str2 = button.title.substr(i+1); + button.appendChild(doc.createTextNode(str1)); + button.appendChild(doc.createElement('br')); + button.appendChild(doc.createTextNode(str2)); + } else { + button.appendChild(doc.createTextNode(button.title)); + } if (elem.firstChild) { elem.removeChild(elem.firstChild); diff --git a/src/main/webapp/resources/lib/fims/biz/paintweb/korean.js b/src/main/webapp/resources/lib/fims/biz/paintweb/korean.js index 51c00c31..81ee4256 100644 --- a/src/main/webapp/resources/lib/fims/biz/paintweb/korean.js +++ b/src/main/webapp/resources/lib/fims/biz/paintweb/korean.js @@ -106,9 +106,10 @@ let lang_ko = { "clipboardPaste": "붙여넣기", "historyRedo": "다시 실행", "historyUndo": "실행취소", - "imageClear": "Clear image", + "imageClear": "이미지 지우기", "imageSave": "이미지 저장", - "imageRotate": "이미지 회전", + "imageRotateLeft": "왼쪽 회전", + "imageRotateRight": "오른쪽 회전", "imageBright": "밝게", "imageDark": "어둡게", diff --git a/src/main/webapp/resources/lib/fims/biz/paintweb/layout.js b/src/main/webapp/resources/lib/fims/biz/paintweb/layout.js index e40d2040..3fc366db 100644 --- a/src/main/webapp/resources/lib/fims/biz/paintweb/layout.js +++ b/src/main/webapp/resources/lib/fims/biz/paintweb/layout.js @@ -1,11 +1,12 @@ let xhtml = `
- +

PaintWeb

+
- - - -
  • Undo
  • +
  • 실행취소
  • - - - +
  •  
  • - - +
  • 자르기

  • 가림막

  • 번호판
  • - - - - - -
  • Rotate image
  • - -
  • brighten image

  • -
  • darken image
  • +
  • 왼쪽 회전

  • +
  • 오른쪽 회전
  • +
    + +
  • 밝게

  • +
  • 어둡게
  • - -
  •  
  • - - - - - - -


  • @@ -86,155 +53,13 @@ let xhtml = `
  •  
  • -
  • Save image
  • +
  • 이미지 저장
  • - - - - - - - - - - - - - - -
    @@ -298,13 +123,17 @@ let xhtml = `
      -
    1. +
    2. +
    3. -
    4. +
    5. +
    @@ -418,5 +247,4 @@ let xhtml = `
    - `; diff --git a/src/main/webapp/resources/lib/fims/biz/paintweb/paintweb.js b/src/main/webapp/resources/lib/fims/biz/paintweb/paintweb.js index 890371d0..acd62968 100644 --- a/src/main/webapp/resources/lib/fims/biz/paintweb/paintweb.js +++ b/src/main/webapp/resources/lib/fims/biz/paintweb/paintweb.js @@ -613,7 +613,8 @@ function PaintWeb (win, doc) { this.commandRegister('selectionCrop', this.selectionCrop) && this.commandRegister('selectionFill', this.selectionFill) && this.commandRegister('selectionForNumberPlate', this.selectionForNumberPlate) && - this.commandRegister('imageRotate', this.imageRotate) && + this.commandRegister('imageRotateRight', this.imageRotateRight) && + this.commandRegister('imageRotateLeft', this.imageRotateLeft) && this.commandRegister('imageBright', this.imageBright) && this.commandRegister('imageDark', this.imageDark) && this.commandRegister('imageSave', this.imageSave) && @@ -2505,52 +2506,63 @@ function PaintWeb (win, doc) { return true; }; - /** - * image rotation. add by gujc. - */ + /** + * image rotation. add by gujc. + */ + this.imageRotateLeft = function() { + _self.imageRotate(false); + }; - this.imageRotate = function (type) { - var layerCanvas = _self.layer.canvas, + this.imageRotateRight = function() { + _self.imageRotate(true); + }; + + this.imageRotate = function(clockwise){ + var layerCanvas = _self.layer.canvas, layerCtx = _self.layer.context, bufferCanvas = _self.buffer.canvas, bufferCtx = _self.buffer.context, - img = _self.image; + img = _self.image; - var bufferStyle = _self.buffer.canvas.style; - var layerStyle = layerCanvas.style; - - - var srcCanvas = doc.createElement('canvas'); - var srcCtx=srcCanvas.getContext("2d"); + var bufferStyle = _self.buffer.canvas.style; + var layerStyle = layerCanvas.style; + + var srcCanvas = doc.createElement('canvas'); + var srcCtx=srcCanvas.getContext("2d"); - srcCanvas.height = layerCanvas.width; - srcCanvas.width = layerCanvas.height; - srcCtx.translate(layerCanvas.height/2,layerCanvas.width/2); - srcCtx.rotate(90*Math.PI/180); - srcCtx.drawImage(layerCanvas,-layerCanvas.width/2,-layerCanvas.height/2); + srcCanvas.height = layerCanvas.width; + srcCanvas.width = layerCanvas.height; + srcCtx.translate(layerCanvas.height/2,layerCanvas.width/2); + if(clockwise){ + srcCtx.rotate(90*Math.PI/180); + } else { + srcCtx.rotate(-90*Math.PI/180); + } + + srcCtx.drawImage(layerCanvas,-layerCanvas.width/2,-layerCanvas.height/2); - var lineWidth = bufferCtx.lineWidth; - var strokeStyle = bufferCtx.strokeStyle; - var fillStyle = bufferCtx.fillStyle; - layerCanvas.width = bufferCanvas.width = srcCanvas.width; - layerCanvas.height = bufferCanvas.height = srcCanvas.height; - bufferCtx.lineWidth = layerCtx.lineWidth = lineWidth; - bufferCtx.strokeStyle = layerCtx.strokeStyle = strokeStyle; - bufferCtx.fillStyle = layerCtx.fillStyle = fillStyle; - - layerCtx.drawImage(srcCanvas, 0, 0); + var lineWidth = bufferCtx.lineWidth; + var strokeStyle = bufferCtx.strokeStyle; + var fillStyle = bufferCtx.fillStyle; + layerCanvas.width = bufferCanvas.width = srcCanvas.width; + layerCanvas.height = bufferCanvas.height = srcCanvas.height; + bufferCtx.lineWidth = layerCtx.lineWidth = lineWidth; + bufferCtx.strokeStyle = layerCtx.strokeStyle = strokeStyle; + bufferCtx.fillStyle = layerCtx.fillStyle = fillStyle; + + layerCtx.drawImage(srcCanvas, 0, 0); - img.width = layerCanvas.width; - img.height = layerCanvas.height; + img.width = layerCanvas.width; + img.height = layerCanvas.height; - bufferStyle.width = layerStyle.width = (layerCanvas.width * img.canvasScale) + 'px'; - bufferStyle.height = layerStyle.height = (layerCanvas.height * img.canvasScale) + 'px'; + bufferStyle.width = layerStyle.width = (layerCanvas.width * img.canvasScale) + 'px'; + bufferStyle.height = layerStyle.height = (layerCanvas.height * img.canvasScale) + 'px'; - _self.events.dispatch(new appEvent.canvasSizeChange(bufferCanvas.width * img.canvasScale, bufferCanvas.height * img.canvasScale, img.canvasScale)); + _self.events.dispatch(new appEvent.canvasSizeChange(bufferCanvas.width * img.canvasScale, bufferCanvas.height * img.canvasScale, img.canvasScale)); - pw.image.modified = true; - return true; - }; + pw.image.modified = true; + return true; + } /** * 밝기 조절(이미지 밝게) diff --git a/src/main/webapp/resources/lib/fims/biz/paintweb/style/style.css b/src/main/webapp/resources/lib/fims/biz/paintweb/style/style.css index 834cd4bd..5681c12a 100644 --- a/src/main/webapp/resources/lib/fims/biz/paintweb/style/style.css +++ b/src/main/webapp/resources/lib/fims/biz/paintweb/style/style.css @@ -999,8 +999,6 @@ .paintweb_cmd_imageSave a { background-image: url('icons/i_save.png') } -.paintweb_cmd_imageRotate a { background-image: url('icons/i_rotation.png') } - .paintweb_cmd_imageClear a { background-image: url('icons/i_delete.png') } .paintweb_cmd_about {