Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

feat: added the ability to set the size of an icon when using a dot s… #4220

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/network/modules/components/nodes/util/ShapeBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ class ShapeBase extends NodeBase {
this.initContextForDraw(ctx, values);
ctx[shape](x, y, values.size);
this.performFill(ctx, values);

if (this.options.icon !== undefined) {
if (this.options.icon.code !== undefined) {
var iconScale = (this.options.icon.scale || 0.5);
ctx.font = (selected ? "bold " : "")
+ (this.height / 2) + "px "
+ Math.round(this.height * iconScale) + "px "
+ (this.options.icon.face || 'FontAwesome');
ctx.fillStyle = this.options.icon.color || "black";
ctx.textAlign = "center";
Expand Down