aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Charles Nicholson <nicholsonc@google.com>2016-11-14 11:46:09 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-14 12:30:31 -0800
commita5a4a541dd67cf0a9774bb29a1847917775c1ab7 (patch)
tree155bc04c505dedf3d43139d1978250663aff917c
parent2ee6a412733fd94e6f11f35ad816d26b6078b0e6 (diff)
Tune canvas label font rendering: use a stroke width of 3px and a fill width of
6px. Change: 139100540
-rw-r--r--tensorflow/tensorboard/components/vz_projector/scatterPlotVisualizerCanvasLabels.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/tensorboard/components/vz_projector/scatterPlotVisualizerCanvasLabels.ts b/tensorflow/tensorboard/components/vz_projector/scatterPlotVisualizerCanvasLabels.ts
index 736f70604a..58d52f39e6 100644
--- a/tensorflow/tensorboard/components/vz_projector/scatterPlotVisualizerCanvasLabels.ts
+++ b/tensorflow/tensorboard/components/vz_projector/scatterPlotVisualizerCanvasLabels.ts
@@ -20,6 +20,8 @@ import {ScatterPlotVisualizer} from './scatterPlotVisualizer';
import * as util from './util';
const MAX_LABELS_ON_SCREEN = 10000;
+const LABEL_STROKE_WIDTH = 3;
+const LABEL_FILL_WIDTH = 6;
/**
* Creates and maintains a 2d canvas on top of the GL canvas. All labels, when
@@ -81,7 +83,6 @@ export class ScatterPlotVisualizerCanvasLabels implements
const camToTarget = camPos.clone().sub(rc.cameraTarget);
let camToPoint = new THREE.Vector3();
- this.gc.lineWidth = 6;
this.gc.textBaseline = 'middle';
this.gc.miterLimit = 2;
@@ -129,9 +130,11 @@ export class ScatterPlotVisualizerCanvasLabels implements
if (sceneIs3D && (rc.labels.useSceneOpacityFlags[i] === 1)) {
opacity = opacityMap(camToPoint.length());
}
- this.gc.strokeStyle = strokeStylePrefix + opacity + ')';
this.gc.fillStyle = fillStylePrefix + opacity + ')';
+ this.gc.strokeStyle = strokeStylePrefix + opacity + ')';
+ this.gc.lineWidth = LABEL_STROKE_WIDTH;
this.gc.strokeText(text, x, y);
+ this.gc.lineWidth = LABEL_FILL_WIDTH;
this.gc.fillText(text, x, y);
}
}