diff --git a/src/client/resources/static/localization/de.csv b/src/client/resources/static/localization/de.csv index 1b4b5d4..615f922 100644 --- a/src/client/resources/static/localization/de.csv +++ b/src/client/resources/static/localization/de.csv @@ -18,6 +18,8 @@ DELETE;Löschen DELETE_TITLE;Löscht das ausgewählte Bild REPLACE_FILES_PROMPT;Bestehende Dateien ersetzen? DISPLAY_OUTLINES;Umriss: +DISABLE_SMOOTHING;Glättung deaktivieren +DISABLE_SMOOTHING_TITLE;Deaktivieren Sie die Bildglättung SCALE;Skalierung: SHOW_SPRITES;Animationen SPRITE_NAME;Sprite-Name: diff --git a/src/client/resources/static/localization/en.csv b/src/client/resources/static/localization/en.csv index c74dd53..7ce9472 100644 --- a/src/client/resources/static/localization/en.csv +++ b/src/client/resources/static/localization/en.csv @@ -36,6 +36,8 @@ TINIFY_TITLE;Tinify using https://tinypng.com TINIFY;Tinify TINIFY_KEY_TITLE;TinyPNG key https://tinypng.com/developers TINIFY_KEY;TinyPNG key +DISABLE_SMOOTHING;Disable smoothing +DISABLE_SMOOTHING_TITLE;Disable image smoothing SCALE;Scale: SCALE_TITLE;Base texture scale FILTER;Filter: diff --git a/src/client/resources/static/localization/es.csv b/src/client/resources/static/localization/es.csv index 9d08d60..68f275e 100644 --- a/src/client/resources/static/localization/es.csv +++ b/src/client/resources/static/localization/es.csv @@ -36,6 +36,8 @@ TINIFY_TITLE;Tinify usando https://tinypng.com TINIFY;Tinify TINIFY_KEY_TITLE;TinyPNG key https://tinypng.com/developers TINIFY_KEY;TinyPNG key +DISABLE_SMOOTHING;Deshabilitar suavizado +DISABLE_SMOOTHING_TITLE;Deshabilitar suavizado de imagen SCALE;Escala: SCALE_TITLE;Escala de la textura base FILTER;Filtro: diff --git a/src/client/resources/static/localization/ru.csv b/src/client/resources/static/localization/ru.csv index 004d76f..38ca73e 100644 --- a/src/client/resources/static/localization/ru.csv +++ b/src/client/resources/static/localization/ru.csv @@ -36,6 +36,8 @@ TINIFY_TITLE;Оптимизировать, используя TinyPNG https://ti TINIFY;Оптимизировать TinyPNG TINIFY_KEY_TITLE;Ключ TinyPNG https://tinypng.com/developers TINIFY_KEY;Ключ TinyPNG +DISABLE_SMOOTHING;Отключить сглаживание +DISABLE_SMOOTHING_TITLE;Отключить сглаживание изображения SCALE;Масштаб: SCALE_TITLE;Текущий масштаб текстуры. Влияет на пересчет размеров и координат при экспорте FILTER;Фильтр: diff --git a/src/client/resources/static/localization/zh-cn.csv b/src/client/resources/static/localization/zh-cn.csv index b8a719d..07b1d17 100644 --- a/src/client/resources/static/localization/zh-cn.csv +++ b/src/client/resources/static/localization/zh-cn.csv @@ -36,6 +36,8 @@ TINIFY_TITLE;Tinify 用法 https://tinypng.com(压缩png) TINIFY;Tinify TINIFY_KEY_TITLE;TinyPNG key https://tinypng.com/developers TINIFY_KEY;TinyPNG key +DISABLE_SMOOTHING;禁用平滑 +DISABLE_SMOOTHING_TITLE;禁用图像平滑 SCALE;放大: SCALE_TITLE;基础纹理缩放 FILTER;滤镜: diff --git a/src/client/ui/PackProperties.jsx b/src/client/ui/PackProperties.jsx index b635800..403a0f1 100644 --- a/src/client/ui/PackProperties.jsx +++ b/src/client/ui/PackProperties.jsx @@ -131,6 +131,7 @@ class PackProperties extends React.Component { data.tinify = ReactDOM.findDOMNode(this.refs.tinify).checked; data.tinifyKey = ReactDOM.findDOMNode(this.refs.tinifyKey).value; data.scale = Number(ReactDOM.findDOMNode(this.refs.scale).value); + data.disableSmoothing = ReactDOM.findDOMNode(this.refs.disableSmoothing).checked; data.filter = ReactDOM.findDOMNode(this.refs.filter).value; data.exporter = ReactDOM.findDOMNode(this.refs.exporter).value; data.fileName = ReactDOM.findDOMNode(this.refs.fileName).value; @@ -161,6 +162,7 @@ class PackProperties extends React.Component { ReactDOM.findDOMNode(this.refs.tinify).checked = this.packOptions.tinify; ReactDOM.findDOMNode(this.refs.tinifyKey).value = this.packOptions.tinifyKey; ReactDOM.findDOMNode(this.refs.scale).value = Number(this.packOptions.scale); + ReactDOM.findDOMNode(this.refs.disableSmoothing).checked = this.packOptions.disableSmoothing; ReactDOM.findDOMNode(this.refs.filter).value = this.packOptions.filter; ReactDOM.findDOMNode(this.refs.exporter).value = this.packOptions.exporter; ReactDOM.findDOMNode(this.refs.fileName).value = this.packOptions.fileName; @@ -308,6 +310,11 @@ class PackProperties extends React.Component { + + {I18.f("DISABLE_SMOOTHING")} + + + {I18.f("SCALE")} diff --git a/src/client/utils/TextureRenderer.js b/src/client/utils/TextureRenderer.js index f56f265..1dbba71 100644 --- a/src/client/utils/TextureRenderer.js +++ b/src/client/utils/TextureRenderer.js @@ -63,6 +63,9 @@ class TextureRenderer { render(data, options={}) { let ctx = this.buffer.getContext("2d"); + let imageSmoothingEnabled = ctx.imageSmoothingEnabled; + ctx.imageSmoothingEnabled = !options.disableSmoothing; + let { width, height } = TextureRenderer.getSize(data, options); this.width = width; @@ -75,6 +78,8 @@ class TextureRenderer { for(let item of data) { this.renderItem(ctx, item, options); } + + ctx.imageSmoothingEnabled = imageSmoothingEnabled; } scale(val) {