Socket
Socket
Sign inDemoInstall

@jiaminghi/c-render

Package Overview
Dependencies
5
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.5 to 0.2.6

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# 0.2.6-alpha (2019-05-14)
### Perfect
- **graph:** `polyline` Eliminate polyline blur due to 1px line width.
# 0.2.5-alpha (2019-05-12)

@@ -2,0 +8,0 @@

5

config/graphs.js

@@ -7,2 +7,3 @@ import beziercurve from '@jiaminghi/bezier-curve'

deepClone,
eliminateBlur,
checkPointIsInCircle,

@@ -465,3 +466,3 @@ getTwoPointDistance,

draw ({ ctx }, { shape }) {
draw ({ ctx }, { shape, style: { lineWidth } }) {
ctx.beginPath()

@@ -471,2 +472,4 @@

if (lineWidth === 1) points = eliminateBlur(points)
drawPolylinePath(ctx, points)

@@ -473,0 +476,0 @@

16

lib/util.js

@@ -39,7 +39,16 @@ const { abs, sqrt, sin, cos, max, min, PI } = Math

/**
* @description Eliminate line blur due to 1px line width
* @param {Array} points Line points
* @return {Array} Line points after processed
*/
export function eliminateBlur (points) {
return points.map(([x, y]) => [parseInt(x) + 0.5, parseInt(y) + 0.5])
}
/**
* @description Check if the point is inside the circle
* @param {Array} point Postion of point
* @param {Number} rx Circle x coordinate
* @param {Number} ry Circle y coordinate
* @param {Number} r Circle radius
* @param {Number} rx Circle x coordinate
* @param {Number} ry Circle y coordinate
* @param {Number} r Circle radius
* @return {Boolean} Result of check

@@ -329,2 +338,3 @@ */

deepClone,
eliminateBlur,
checkPointIsInCircle,

@@ -331,0 +341,0 @@ checkPointIsInPolygon,

{
"name": "@jiaminghi/c-render",
"version": "0.2.5",
"version": "0.2.6",
"author": "JiaMing <743192023@qq.com>",

@@ -5,0 +5,0 @@ "description": "Canvas-based vector graphics rendering plugin",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc