From f06f2c9b2a4486ee49d3c3de2e5808cef75a7f56 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Fri, 15 Jan 2021 11:53:39 +0800 Subject: [PATCH] Fix Warning --- debug.log | 1 + src/components/param/FrameworkParam.js | 1 - src/components/param/disposable/ParamIcon.js | 4 ++-- src/components/preset/PresetModal.js | 6 ++++++ src/components/renderer/Renderer25D.js | 20 +++++++++++--------- src/components/renderer/RendererBase.js | 6 +++--- src/components/renderer/RendererFunc.js | 4 ++-- src/components/renderer/RendererLine.js | 2 +- src/components/renderer/RendererResImage.js | 12 +++++++----- src/components/style/Renderer.js | 13 ++++++++----- 10 files changed, 41 insertions(+), 28 deletions(-) create mode 100644 debug.log create mode 100644 src/components/preset/PresetModal.js diff --git a/debug.log b/debug.log new file mode 100644 index 0000000..7f19886 --- /dev/null +++ b/debug.log @@ -0,0 +1 @@ +[0113/225246.323:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) diff --git a/src/components/param/FrameworkParam.js b/src/components/param/FrameworkParam.js index a0d0337..95fe6cd 100644 --- a/src/components/param/FrameworkParam.js +++ b/src/components/param/FrameworkParam.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types' import '../Qrcode.css'; const FrameworkParam = ({ paramName, children, ...other }) => ( diff --git a/src/components/param/disposable/ParamIcon.js b/src/components/param/disposable/ParamIcon.js index ac94339..5a7c337 100644 --- a/src/components/param/disposable/ParamIcon.js +++ b/src/components/param/disposable/ParamIcon.js @@ -9,7 +9,7 @@ const IconParams = ({ icon, onBlur, onKeyPress }) => { const { enabled, src, scale } = icon; const components = []; - if (getExactValue(enabled, 0) == 1) { + if (getExactValue(enabled, 0) === 1) { components.push( @@ -17,7 +17,7 @@ const IconParams = ({ icon, onBlur, onKeyPress }) => { ); } - if (getExactValue(enabled, 0) != 0) { + if (getExactValue(enabled, 0) !== 0) { components.push( { + +} diff --git a/src/components/renderer/Renderer25D.js b/src/components/renderer/Renderer25D.js index 0ae6a5f..587602d 100644 --- a/src/components/renderer/Renderer25D.js +++ b/src/components/renderer/Renderer25D.js @@ -34,13 +34,13 @@ function listPoints({ qrcode, params, icon }) { if (qrcode.isDark(x, y) === false) continue; else if (typeTable[x][y] === QRPointType.POS_OTHER || typeTable[x][y] === QRPointType.POS_CENTER) { pointList.push(); - pointList.push(); - pointList.push(); + pointList.push(); + pointList.push(); } else { pointList.push(); - pointList.push(); - pointList.push(); + pointList.push(); + pointList.push(); } } } @@ -100,13 +100,14 @@ let defaultDrawIcon = function ({ qrcode, params, title, icon }) { const randomIdClips = getIdNum(); pointList.push( - + ); pointList.push( - + + @@ -184,18 +185,19 @@ let builtinDrawIcon = function ({ qrcode, params, title, icon }) { const randomIdClips = getIdNum(); pointList.push( - + ); pointList.push( - + + - + {builtinIcon()} diff --git a/src/components/renderer/RendererBase.js b/src/components/renderer/RendererBase.js index 2164c36..50cf505 100644 --- a/src/components/renderer/RendererBase.js +++ b/src/components/renderer/RendererBase.js @@ -1,7 +1,7 @@ import React from "react"; import {ParamTypes} from "../../constant/ParamTypes"; import {getTypeTable, QRPointType} from "../../utils/qrcodeHandler"; -import {createRenderer, defaultDrawIcon} from "../style/Renderer"; +import {createRenderer} from "../style/Renderer"; import {getExactValue, rand} from "../../utils/util"; import LinkTrace from "../link/LinkTrace"; @@ -14,7 +14,7 @@ function listPoints({ qrcode, params, icon }) { const {src, scale} = icon; const iconSize = Number(nCount * (scale > .33 ? .33 : scale)); - const iconXY = (nCount - iconSize) / 2; + // const iconXY = (nCount - iconSize) / 2; function nearIcon(x, y) { return Math.pow((nCount - 1) / 2 - x, 2) + Math.pow((nCount - 1) / 2 - y, 2) < Math.pow(iconSize / 2, 2); @@ -67,7 +67,7 @@ function listPoints({ qrcode, params, icon }) { } } else if (posType === 3) { pointList.push() - pointList.push() + pointList.push() } } else if (typeTable[x][y] === QRPointType.POS_OTHER) { diff --git a/src/components/renderer/RendererFunc.js b/src/components/renderer/RendererFunc.js index 52753b5..b9bb51f 100644 --- a/src/components/renderer/RendererFunc.js +++ b/src/components/renderer/RendererFunc.js @@ -51,7 +51,7 @@ function listPoints({ qrcode, params, icon }) { } } else if (posType === 3) { pointList.push() - pointList.push() + pointList.push() } } else if (qrcode.isDark(x, y) && typeTable[x][y] === QRPointType.POS_OTHER) { @@ -76,7 +76,7 @@ function listPoints({ qrcode, params, icon }) { if (funcType === 1) { let sizeF = 0 let colorF = otherColor - let fillF = colorF + // let fillF = colorF let opacityF = Number(qrcode.isDark(x, y)); if (dist > 5/20 && dist < 8/20) { sizeF = 5/10 diff --git a/src/components/renderer/RendererLine.js b/src/components/renderer/RendererLine.js index e81686f..002561b 100644 --- a/src/components/renderer/RendererLine.js +++ b/src/components/renderer/RendererLine.js @@ -58,7 +58,7 @@ function listPoints({ qrcode, params, icon }) { } } else if (posType === 3) { pointList.push() - pointList.push() + pointList.push() } } else if (typeTable[x][y] === QRPointType.POS_OTHER) { diff --git a/src/components/renderer/RendererResImage.js b/src/components/renderer/RendererResImage.js index 8453443..ab5adf2 100644 --- a/src/components/renderer/RendererResImage.js +++ b/src/components/renderer/RendererResImage.js @@ -175,11 +175,13 @@ let defaultDrawIcon = function ({ qrcode, params, title, icon }) { if (icon && iconEnabled) { const randomIdDefs = getIdNum(); const randomIdClips = getIdNum(); - pointList.push(); + + pointList.push(); pointList.push( - + + @@ -255,16 +257,16 @@ let builtinDrawIcon = function ({ qrcode, params, title, icon }) { if (icon && iconMode) { const randomIdDefs = getIdNum(); const randomIdClips = getIdNum(); - pointList.push(); + pointList.push(); pointList.push( - + - + {builtinIcon()} diff --git a/src/components/style/Renderer.js b/src/components/style/Renderer.js index 3b53999..6a978f4 100644 --- a/src/components/style/Renderer.js +++ b/src/components/style/Renderer.js @@ -35,11 +35,13 @@ let defaultDrawIcon = function ({ qrcode, params, title, icon }) { if (icon && iconEnabled) { const randomIdDefs = getIdNum(); const randomIdClips = getIdNum(); - pointList.push(); + + pointList.push(); pointList.push( - + + @@ -115,16 +117,17 @@ let builtinDrawIcon = function ({ qrcode, params, title, icon }) { if (icon && iconMode) { const randomIdDefs = getIdNum(); const randomIdClips = getIdNum(); - pointList.push(); + pointList.push(); pointList.push( - + + - + {builtinIcon()}