Skip to content

Commit

Permalink
C2 Icon 修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaochaos committed Sep 1, 2020
1 parent 26871b5 commit 8c56cb3
Show file tree
Hide file tree
Showing 2 changed files with 674 additions and 732 deletions.
12 changes: 6 additions & 6 deletions src/components/renderer/RendererResImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ let defaultDrawIcon = function ({ qrcode, params, title, icon }) {
const iconEnabled = getExactValue(icon.enabled, 0);
const {src, scale} = icon;

const iconSize = Number(nCount * (scale > 33 ? 33 : scale) / 100);
const iconXY = (nCount - iconSize) / 2;
const iconSize = Number(nCount * (scale > 33 ? 33 : scale) / 100 * 3);
const iconXY = (nCount*3 - iconSize) / 2;

if (icon && iconEnabled) {
const randomIdDefs = getIdNum();
const randomIdClips = getIdNum();
pointList.push(<path d={sq25} stroke="#FFF" strokeWidth={100/iconSize * 1} fill="#FFF" transform={'translate('+String(iconXY)+','+String(iconXY)+') ' + 'scale(' + String(iconSize/100) + ',' + String(iconSize/100) + ')'} />);
pointList.push(<path d={sq25} stroke="#FFF" strokeWidth={100/iconSize * 3} fill="#FFF" transform={'translate('+String(iconXY)+','+String(iconXY)+') ' + 'scale(' + String(iconSize/100) + ',' + String(iconSize/100) + ')'} />);
pointList.push(
<g key={id++}>
<defs>
Expand Down Expand Up @@ -208,8 +208,8 @@ let builtinDrawIcon = function ({ qrcode, params, title, icon }) {
const iconMode = getExactValue(icon.enabled, 0);
const {src, scale} = icon;

const iconSize = Number(nCount * (scale > 33 ? 33 : scale) / 100);
const iconXY = (nCount - iconSize) / 2;
const iconSize = Number(nCount * (scale > 33 ? 33 : scale) / 100 * 3);
const iconXY = (nCount*3 - iconSize) / 2;

const WeChatIconSmall = (
<g>
Expand Down Expand Up @@ -255,7 +255,7 @@ let builtinDrawIcon = function ({ qrcode, params, title, icon }) {
if (icon && iconMode) {
const randomIdDefs = getIdNum();
const randomIdClips = getIdNum();
pointList.push(<path d={sq25} stroke="#FFF" strokeWidth={100/iconSize * 1} fill="#FFF" transform={'translate('+String(iconXY)+','+String(iconXY)+') ' + 'scale(' + String(iconSize/100) + ',' + String(iconSize/100) + ')'} />);
pointList.push(<path d={sq25} stroke="#FFF" strokeWidth={100/iconSize * 3} fill="#FFF" transform={'translate('+String(iconXY)+','+String(iconXY)+') ' + 'scale(' + String(iconSize/100) + ',' + String(iconSize/100) + ')'} />);
pointList.push(
<g key={id++}>
<defs>
Expand Down
Loading

0 comments on commit 8c56cb3

Please sign in to comment.