Przeglądaj źródła

fix: Skia rendering issues (#4200)

David Luzar 3 lat temu
rodzic
commit
f59e608f18
3 zmienionych plików z 7 dodań i 6 usunięć
  1. 1 1
      package.json
  2. 2 1
      src/renderer/renderElement.ts
  3. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -49,7 +49,7 @@
     "react": "17.0.2",
     "react-dom": "17.0.2",
     "react-scripts": "4.0.3",
-    "roughjs": "4.4.3",
+    "roughjs": "4.4.4",
     "sass": "1.43.4",
     "socket.io-client": "2.3.1",
     "typescript": "4.4.4"

+ 2 - 1
src/renderer/renderElement.ts

@@ -323,12 +323,13 @@ export const generateRoughOptions = (
     roughness: element.roughness,
     stroke: element.strokeColor,
     preserveVertices: continuousPath,
+    // disable decimals to fix Skia rendering issues #4046
+    fixedDecimalPlaceDigits: 0,
   };
 
   switch (element.type) {
     case "rectangle":
     case "diamond":
-    case "image":
     case "ellipse": {
       options.fillStyle = element.fillStyle;
       options.fill =

+ 4 - 4
yarn.lock

@@ -12797,10 +12797,10 @@ rollup@^1.31.1:
     "@types/node" "*"
     acorn "^7.1.0"
 
-roughjs@4.4.3:
-  version "4.4.3"
-  resolved "https://registry.yarnpkg.com/roughjs/-/roughjs-4.4.3.tgz#c6278e1bfe6e16bfd8470d8a835236a81df877f9"
-  integrity sha512-bfeqk/dWmQUkn6HHvKGJlENOSHxmPZ9pS33u9WtK8UeQRvqrJZ+2i7AgyOsUurEc9LqOLGHN2L6oUiaQxcdljg==
+roughjs@4.4.4:
+  version "4.4.4"
+  resolved "https://registry.yarnpkg.com/roughjs/-/roughjs-4.4.4.tgz#880e2ef0cb195f0e7e3096f0a2d474121ae874fe"
+  integrity sha512-OXoPkOIoT1vlo+kvy6JZemRxRPkWM5spWUCU+c8JI6bca95tc1Z82SBABRHH+aTpvI+ZK3STGrmvire/f56wvQ==
   dependencies:
     path-data-parser "^0.1.0"
     points-on-curve "^0.2.0"