Skip to content
This repository was archived by the owner on Jul 13, 2024. It is now read-only.

Commit ee38867

Browse files
prudynicoespeon
authored andcommitted
Add dotFont option and a default for it.
1 parent 233d082 commit ee38867

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/gitgraph.js

+7
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@
626626
* @property {string} [tagFont = this.template.commit.tag.font] - Font of the tag
627627
* @property {string} [displayTagBox = true] - If true, display a box around the tag
628628
*
629+
* @property {string} [fotFont = this.template.commit.dot.font] - Font of the dot
629630
* @property {string} [dotColor = color] - Specific dot color
630631
* @property {number} [dotSize = this.template.commit.dot.size] - Dot size
631632
* @property {number} [dotStrokeWidth = this.template.commit.dot.strokeWidth] - Dot stroke width
@@ -1046,6 +1047,8 @@
10461047
* @param {string} [options.tagFont = this.template.commit.tag.font] - Font of the tag
10471048
* @param {string} [options.displayTagBox = true] - If true, display a box around the tag
10481049
*
1050+
1051+
* @param {string} [options.dotFont = this.template.commit.dot.font] - Font of the dot
10491052
* @param {string} [options.dotColor = options.color] - Specific dot color
10501053
* @param {number} [options.dotSize = this.template.commit.dot.size] - Dot size
10511054
* @param {number} [options.dotStrokeWidth = this.template.commit.dot.strokeWidth] - Dot stroke width
@@ -1095,6 +1098,7 @@
10951098
this.messageHashDisplay = _booleanOptionOr(options.messageHashDisplay, this.template.commit.message.displayHash);
10961099
this.messageColor = options.messageColor || options.color;
10971100
this.messageFont = options.messageFont || this.template.commit.message.font;
1101+
this.dotFont = options.dotFont || this.template.commit.dot.font;
10981102
this.dotColor = options.dotColor || options.color;
10991103
this.dotSize = options.dotSize || this.template.commit.dot.size;
11001104
this.dotStrokeWidth = options.dotStrokeWidth || this.template.commit.dot.strokeWidth;
@@ -1212,6 +1216,7 @@
12121216
var previousTextBaseline = this.context.textBaseline;
12131217
var previousTextAlign = this.context.textAlign;
12141218

1219+
this.context.font = this.dotFont;
12151220
this.context.fillStyle = "#000";
12161221
this.context.textAlign = "center";
12171222
this.context.textBaseline = "middle";
@@ -1392,6 +1397,7 @@
13921397
* @param {number} [options.commit.spacingY] - Space between commits
13931398
* @param {number} [options.commit.widthExtension = 0] - Additional width to be added to the calculated width
13941399
* @param {string} [options.commit.color] - Master commit color (dot & message)
1400+
* @param {string} [options.commit.dot.font] - Commit dot color
13951401
* @param {string} [options.commit.dot.color] - Commit dot color
13961402
* @param {number} [options.commit.dot.size] - Commit dot size
13971403
* @param {number} [options.commit.dot.strokeWidth] - Commit dot stroke width
@@ -1466,6 +1472,7 @@
14661472
this.commit.dot = {};
14671473

14681474
// Only one color, if null message takes branch color (only dot)
1475+
this.commit.dot.font = options.commit.dot.font || "normal 10pt Calibri";
14691476
this.commit.dot.color = options.commit.dot.color || null;
14701477
this.commit.dot.size = options.commit.dot.size || 3;
14711478
this.commit.dot.strokeWidth = options.commit.dot.strokeWidth || null;

0 commit comments

Comments
 (0)