Skip to content

Commit 2f01e99

Browse files
author
Kinon
committed
Enable to set diagram's arrow style with CSS
1 parent 27495fe commit 2f01e99

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

TypeMath/app.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ class Application
146146
private dragRect: Rect = null;
147147

148148
public candMax = 16;
149-
public activeArrowColor = "#f39";
150-
public intendedArrowColor = "#999";
151149

152150
private digits: string[] = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
153151
private symbols: string[] = [
@@ -2545,7 +2543,8 @@ class Application
25452543
var shift = 10 * (k - (as.length - 1) / 2);
25462544
if (active && k == this.diagramOption.arrowIndex)
25472545
{
2548-
d.drawArrow(ctx, box, label, a, shift, this.activeField == d ? this.activeArrowColor : null);
2546+
var color = $("<div/>").addClass("activeArrow").css("color");
2547+
d.drawArrow(ctx, box, label, a, shift, this.activeField == d ? color : null);
25492548
selected = true;
25502549
}
25512550
else
@@ -2562,7 +2561,8 @@ class Application
25622561
num: this.diagramOption.num,
25632562
label: null, labelPos: null
25642563
};
2565-
d.drawArrow(ctx, box, null, a, 0, this.intendedArrowColor);
2564+
var color = $("<div/>").addClass("intendedArrow").css("color");
2565+
d.drawArrow(ctx, box, null, a, 0, color);
25662566
}
25672567
if (!selected && d == this.activeField) // otherwise arrowIndex is kept to undo leaving an arrow label
25682568
this.diagramOption.arrowIndex = -1;

TypeMath/formula.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@
111111
position: absolute;
112112
font-size: smaller;
113113
}
114+
.activeArrow
115+
{
116+
color: #f39;
117+
}
118+
.intendedArrow
119+
{
120+
color: #999;
121+
}
114122

115123
.label
116124
{

0 commit comments

Comments
 (0)