From 81ad041f3735e50d19301b981ac29fc84ba1bed4 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sun, 8 Apr 2018 12:22:53 -0700 Subject: [PATCH] Fix opacity bug - Closes #317 --- components/Editor.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/Editor.js b/components/Editor.js index 2d4fafe..1252911 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -103,11 +103,18 @@ class Editor extends React.Component { 'transform-origin': 'center', background: this.state.squaredImage ? this.state.backgroundColor : 'none' }, - filter: n => (n.className ? String(n.className).indexOf('eliminateOnRender') < 0 : true), + filter: n => { + // %[00 -> 19] cause failures + if (n.innerText && n.innerText.match(/%[0-1][0-9]/)) { + return false + } + if (n.className) { + return String(n.className).indexOf('eliminateOnRender') < 0 + } + return true + }, width, - height, - // %[00 -> 19] cause failures - filter: node => !(node.innerText && node.innerText.match(/%[0-1][0-9]/)) + height } if (type === 'blob')