Skip to content

Commit 8b21fd8

Browse files
and-oliDevtools-frontend LUCI CQ
authored andcommitted
Make initiator arrows more visible
Especially in dark mode Light mode: Before: https://screenshot.googleplex.com/4EUh9C7io87Ut6k After: https://screenshot.googleplex.com/5nvYxHqWzBRJMah Dark mode: Before: https://screenshot.googleplex.com/4HNqbEaBKdML8cQ After: https://screenshot.googleplex.com/68TzNueNpCKhXkk Bug: 406010014 Change-Id: I8c1be4b800a85ef0f8a1045e246321878975af3d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6421725 Reviewed-by: Paul Irish <[email protected]> Commit-Queue: Andres Olivares <[email protected]> Feels: Paul Irish <[email protected]>
1 parent c0e9085 commit 8b21fd8

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

front_end/ui/legacy/components/perf_ui/FlameChart.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3173,9 +3173,9 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
31733173
context.save();
31743174
context.scale(ratio, ratio);
31753175
context.translate(0, -top);
3176-
3177-
context.fillStyle = '#7f5050';
3178-
context.strokeStyle = '#7f5050';
3176+
const arrowColor = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface-subtle');
3177+
context.fillStyle = arrowColor;
3178+
context.strokeStyle = arrowColor;
31793179

31803180
for (let i = 0; i < td.initiatorsData.length; ++i) {
31813181
const initiatorsData = td.initiatorsData[i];
@@ -3229,16 +3229,18 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
32293229
const endY = this.levelToOffset(endLevel) + this.levelHeight(endLevel) / 2;
32303230
const lineLength = endX - startX;
32313231

3232-
// Make line an arrow if the line is long enough to fit the arrow head. Otherwise, draw a thinner line without the arrow head.
3232+
context.lineWidth = 1;
3233+
context.shadowColor = 'rgba(0, 0, 0, 0.3)';
3234+
context.shadowOffsetX = 2;
3235+
context.shadowOffsetY = 2;
3236+
context.shadowBlur = 3;
32333237
if (lineLength > arrowWidth) {
3234-
context.lineWidth = 0.5;
3238+
// Add an arrow to the line if the line is long enough.
32353239
context.beginPath();
32363240
context.moveTo(endX, endY);
32373241
context.lineTo(endX - arrowLineWidth, endY - 3);
32383242
context.lineTo(endX - arrowLineWidth, endY + 3);
32393243
context.fill();
3240-
} else {
3241-
context.lineWidth = 0.2;
32423244
}
32433245

32443246
if (initiatorEndsBeforeInitiatedStart) {
2.82 KB
Loading

test/interactions/panels/performance/timeline/flamechart_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('FlameChart', function() {
3333
await assertElementScreenshotUnchanged(flameChart, 'performance/flame_chart_decorations.png');
3434
});
3535

36-
itScreenshot('can add initiators to events', async () => {
36+
it('can add initiators to events', async () => {
3737
await loadComponentDocExample('performance_panel/flamechart.html');
3838
const flameChart = await getFlameChartContainerWhenReady('#initiators');
3939
await assertElementScreenshotUnchanged(flameChart, 'performance/multiple_initiators.png');

0 commit comments

Comments
 (0)