Skip to content

Commit 5a2e246

Browse files
committed
More 11th hour mark fixing for 1.1.
1 parent 40115f4 commit 5a2e246

3 files changed

Lines changed: 13 additions & 23 deletions

File tree

compiled/glift.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiled/glift_combined.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5413,20 +5413,15 @@ glift.displays.board.addMark = function(
54135413
// stones.
54145414
threeDigitMod = .75;
54155415
}
5416-
var stroke = 'none';
5417-
var strokeWidth = 'none';
5418-
if (stoneColor === glift.enums.states.EMPTY ||
5419-
stoneColor === glift.enums.states.WHITE) {
5420-
// Hackery to work around the fact that we want a stroke for white but not
5421-
// for black because, well, it looks better that way
5422-
stroke = marksTheme.stroke;
5423-
strokeWidth = marksTheme['stroke-width'];
5416+
var strokeWidth = parseInt(marksTheme['stroke-width'] || 1, 10)
5417+
if (stoneColor === glift.enums.states.BLACK) {
5418+
strokeWidth = strokeWidth * 0.4;
54245419
}
54255420
container.append(svglib.text()
54265421
.setText(label)
54275422
.setData(pt)
54285423
.setAttr('fill', marksTheme.fill)
5429-
.setAttr('stroke', stroke)
5424+
.setAttr('stroke', marksTheme.stroke)
54305425
.setAttr('stroke-width', strokeWidth)
54315426
.setAttr('text-anchor', 'middle')
54325427
.setAttr('dy', '.33em') // for vertical centering

src/displays/board/marks.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,15 @@ glift.displays.board.addMark = function(
5050
// stones.
5151
threeDigitMod = .75;
5252
}
53-
var stroke = 'none';
54-
var strokeWidth = 'none';
55-
if (stoneColor === glift.enums.states.EMPTY ||
56-
stoneColor === glift.enums.states.WHITE) {
57-
// Hackery to work around the fact that we want a stroke for white but not
58-
// for black because, well, it looks better that way
59-
stroke = marksTheme.stroke;
60-
strokeWidth = marksTheme['stroke-width'];
53+
var strokeWidth = parseInt(marksTheme['stroke-width'] || 1, 10)
54+
if (stoneColor === glift.enums.states.BLACK) {
55+
strokeWidth = strokeWidth * 0.4;
6156
}
6257
container.append(svglib.text()
6358
.setText(label)
6459
.setData(pt)
6560
.setAttr('fill', marksTheme.fill)
66-
.setAttr('stroke', stroke)
61+
.setAttr('stroke', marksTheme.stroke)
6762
.setAttr('stroke-width', strokeWidth)
6863
.setAttr('text-anchor', 'middle')
6964
.setAttr('dy', '.33em') // for vertical centering

0 commit comments

Comments
 (0)