Skip to content

Commit e088c04

Browse files
committed
Change default rect color to black
When a rectangle's specified color was black (0x000000) it was considered as a falsy value so the default white (0xffffff) was used instead. This changes the default color to black (0x000000) so that both falsy and specified black colors will we drawn in black. Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
1 parent 5338317 commit e088c04

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

timeline-chart/src/components/time-graph-component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export abstract class TimeGraphComponent<T> {
9090
protected rect(opts: TimeGraphStyledRect) {
9191
const { position, width, height, color, opacity, borderColor, borderWidth } = opts;
9292
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
93-
this.displayObject.beginFill((color || 0xffffff), this.getPIXIOpacity(opacity));
93+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
9494
this.displayObject.drawRect(position.x, position.y, width, height);
9595
this.displayObject.endFill();
9696
this.startPixiRender();
@@ -99,7 +99,7 @@ export abstract class TimeGraphComponent<T> {
9999
protected rectTruncated(opts: TimeGraphStyledRect) {
100100
const { position, width, height, color, opacity, borderColor, borderWidth } = opts;
101101
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
102-
this.displayObject.beginFill((color || 0xffffff), this.getPIXIOpacity(opacity));
102+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
103103
if (width > 20) {
104104
const xpos = position.x + 0.5;
105105
const ypos = position.y + 0.5;
@@ -117,7 +117,7 @@ export abstract class TimeGraphComponent<T> {
117117
protected roundedRect(opts: TimeGraphStyledRect) {
118118
const { position, width, height, color, opacity, borderColor, borderWidth, borderRadius } = opts;
119119
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
120-
this.displayObject.beginFill((color || 0xffffff), this.getPIXIOpacity(opacity));
120+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
121121

122122
this.displayObject.drawRoundedRect(position.x + 0.5, position.y + 0.5, width, height, borderRadius || 0);
123123

0 commit comments

Comments
 (0)