Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-canvas

Package Overview
Dependencies
Maintainers
24
Versions
352
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-canvas - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

11

esm/canvas.js

@@ -108,7 +108,10 @@ import { __extends } from "tslib";

region = getMergedRegion(elements);
// 附加 0.5 像素,会解决1px 变成 2px 的问题,无论 pixelRatio 的值是多少
// 真实测试的环境下,发现在 1-2 之间时会出现 >2 和 <1 的情况下未出现,但是为了安全,统一附加 0.5
var appendPixel = 0.5;
if (region) {
region.minX = Math.floor(region.minX);
region.minY = Math.floor(region.minY);
region.maxX = Math.ceil(region.maxX);
region.maxY = Math.ceil(region.maxY);
region.minX = Math.floor(region.minX - appendPixel);
region.minY = Math.floor(region.minY - appendPixel);
region.maxX = Math.ceil(region.maxX + appendPixel);
region.maxY = Math.ceil(region.maxY + appendPixel);
}

@@ -115,0 +118,0 @@ }

@@ -110,7 +110,10 @@ "use strict";

region = draw_1.getMergedRegion(elements);
// 附加 0.5 像素,会解决1px 变成 2px 的问题,无论 pixelRatio 的值是多少
// 真实测试的环境下,发现在 1-2 之间时会出现 >2 和 <1 的情况下未出现,但是为了安全,统一附加 0.5
var appendPixel = 0.5;
if (region) {
region.minX = Math.floor(region.minX);
region.minY = Math.floor(region.minY);
region.maxX = Math.ceil(region.maxX);
region.maxY = Math.ceil(region.maxY);
region.minX = Math.floor(region.minX - appendPixel);
region.minY = Math.floor(region.minY - appendPixel);
region.maxX = Math.ceil(region.maxX + appendPixel);
region.maxY = Math.ceil(region.maxY + appendPixel);
}

@@ -117,0 +120,0 @@ }

{
"name": "@antv/g-canvas",
"version": "0.4.0",
"version": "0.4.1",
"description": "A canvas library which providing 2d",

@@ -61,7 +61,7 @@ "main": "lib/index.js",

"@antv/gl-matrix": "~2.7.1",
"@antv/path-util": "~2.0.3-beta.1",
"@antv/path-util": "~2.0.5",
"@antv/util": "~2.0.0"
},
"__npminstall_done": false,
"gitHead": "95487b1e5ded41f5db351a622adf12659f564d8b"
"gitHead": "418a25b95749908307ab6610d8a67a72d573e55c"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc