Draw the game view letterbox in the editor background colour
The bars around the camera frame in the Game tab were pure black. They now take Theme.colors.background, so the tab blends in with the rest of the editor instead of framing the game in a black box. - GameViewport drops LETTERBOX_COLOR and uses the theme colour for both the letterbox and the model frame. - e2e 3f checked "the crate is drawn, not letterbox" against #000000. With the new colour that would pass whatever is drawn, so it now compares against #1b1d22. Tests: - ./check.sh: 178 files, 2575 tests, CHECK EXIT 0 - GM_STEPS=1-3,46: ALL PASSED, 94 checks (3f reads #e0553f) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e0b471c354
commit
a90ef4c22f
2 files changed
+7
-6
No files matched your search
@@ -6,7 +6,7 @@ import { type FederatedPointerEvent, Text } from 'pixi.js';
|
||||
import { isSymbolType } from '../../core/model/AssetTypes';
|
||||
import type { EditorState } from '../state';
|
||||
import type { World } from '../../runtime/World';
|
||||
import { textStyle, ui } from '../../ui';
|
||||
import { Theme, textStyle, ui } from '../../ui';
|
||||
import { type ActiveCamera, cameraOfItems, cameraOfWorld } from '../../viewport/activeCamera';
|
||||
import { collectHolderItems, collectWorldItems } from '../../viewport/items';
|
||||
import {
|
||||
@@ -19,8 +19,6 @@ import {
|
||||
} from '../../viewport/view';
|
||||
import { type Frame, WorldViewport } from './WorldViewport';
|
||||
|
||||
const LETTERBOX_COLOR = 0x000000;
|
||||
|
||||
export class GameViewport extends WorldViewport {
|
||||
private readonly hint = new Text({ text: 'No active camera', style: textStyle('muted') });
|
||||
private readonly editorRunCaption = new Text({
|
||||
@@ -102,7 +100,9 @@ export class GameViewport extends WorldViewport {
|
||||
}
|
||||
|
||||
private modelFrame(): Frame {
|
||||
return collectHolderItems(this.state.project, this.state.activeScene, LETTERBOX_COLOR, this.editorWorld);
|
||||
const state = this.state;
|
||||
const background = Theme.colors.background;
|
||||
return collectHolderItems(state.project, state.activeScene, background, this.editorWorld);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +134,7 @@ export class GameViewport extends WorldViewport {
|
||||
}
|
||||
|
||||
protected override get baseColor(): number {
|
||||
return LETTERBOX_COLOR;
|
||||
return Theme.colors.background;
|
||||
}
|
||||
|
||||
protected override beforeItems(view: View | null): void {
|
||||
|
||||
@@ -254,7 +254,8 @@ export async function play(t) {
|
||||
);
|
||||
check(
|
||||
'and the crate is really drawn there, not left as letterbox',
|
||||
previewPixel !== '#000000',
|
||||
// The letterbox is Theme.colors.background.
|
||||
previewPixel !== '#1b1d22',
|
||||
previewPixel,
|
||||
);
|
||||
await shot('10c-game-preview');
|
||||
|
||||
Reference in new issue
Block a user