cytoscape
Advanced tools
Comparing version 3.28.0 to 3.28.1
{ | ||
"name": "cytoscape", | ||
"version": "3.28.0", | ||
"version": "3.28.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -11,3 +11,3 @@ <img style="width: 200px; height: 200px;" src="https://raw.githubusercontent.com/cytoscape/cytoscape.js/unstable/documentation/img/cytoscape-logo.png" width="200" height="200"> | ||
[![Automated tests](https://github.com/cytoscape/cytoscape.js/actions/workflows/tests.yml/badge.svg)](https://github.com/cytoscape/cytoscape.js/actions/workflows/tests.yml) | ||
[![Extensions](https://img.shields.io/badge/Extensions-67-brightgreen.svg)](https://js.cytoscape.org/#extensions) | ||
[![Extensions](https://img.shields.io/badge/Extensions-68-brightgreen.svg)](https://js.cytoscape.org/#extensions) | ||
[![Cloudflare](https://img.shields.io/badge/Powered%20by-Cloudflare-orange.svg)](https://cloudflare.com) | ||
@@ -14,0 +14,0 @@ |
@@ -133,3 +133,3 @@ import * as util from '../../../util'; | ||
// TODO ensure re-used | ||
function roundRect( ctx, x, y, width, height, radius = 5 ){ | ||
function roundRect( ctx, x, y, width, height, radius = 5, stroke){ | ||
ctx.beginPath(); | ||
@@ -146,3 +146,6 @@ ctx.moveTo( x + radius, y ); | ||
ctx.closePath(); | ||
ctx.fill(); | ||
if(stroke) | ||
ctx.stroke(); | ||
else | ||
ctx.fill(); | ||
} | ||
@@ -242,2 +245,5 @@ | ||
let backgroundPadding = ele.pstyle( 'text-background-padding' ).pfValue; | ||
let styleShape = ele.pstyle( 'text-background-shape' ).strValue; | ||
let rounded = styleShape.indexOf('round') === 0; | ||
let roundRadius = 2; | ||
@@ -267,5 +273,4 @@ if( backgroundOpacity > 0 || ( textBorderWidth > 0 && borderOpacity > 0 ) ){ | ||
context.fillStyle = 'rgba(' + textBackgroundColor[ 0 ] + ',' + textBackgroundColor[ 1 ] + ',' + textBackgroundColor[ 2 ] + ',' + backgroundOpacity * parentOpacity + ')'; | ||
let styleShape = ele.pstyle( 'text-background-shape' ).strValue; | ||
if( styleShape.indexOf('round') === 0 ){ | ||
roundRect( context, bgX, bgY, bgW, bgH, 2 ); | ||
if( rounded ){ | ||
roundRect( context, bgX, bgY, bgW, bgH, roundRadius ); | ||
} else { | ||
@@ -304,8 +309,15 @@ context.fillRect( bgX, bgY, bgW, bgH ); | ||
context.strokeRect( bgX, bgY, bgW, bgH ); | ||
if( rounded ){ | ||
roundRect( context, bgX, bgY, bgW, bgH, roundRadius, 'stroke' ); | ||
} else { | ||
context.strokeRect( bgX, bgY, bgW, bgH ); | ||
} | ||
if( textBorderStyle === 'double' ){ | ||
let whiteWidth = textBorderWidth / 2; | ||
context.strokeRect( bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2 ); | ||
if( rounded ){ | ||
roundRect( context, bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2, roundRadius, 'stroke' ); | ||
} else { | ||
context.strokeRect( bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2 ); | ||
} | ||
} | ||
@@ -312,0 +324,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
4448146
113025