refactor: Update bottom controls for improved styling and functionality
- Adjusted button styles across various components for consistency and better UX. - Enhanced layout of action controls to utilize whitespace more effectively. - Updated slider styles for a more modern appearance and improved usability. - Refined input fields and labels for better accessibility and readability. - Introduced new app surface styles for a cohesive design across the application. - Added tests for canvas cursor behavior to ensure correct cursor display during operations.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { ImageDocument } from "@core/document";
|
||||
import type { EditorState } from "@editor/state";
|
||||
import { createDocumentReadIndex } from "@editor/document-indexes";
|
||||
import { renderArtboard } from "./artboard";
|
||||
import { createBrushPreviewRenderer } from "./brush-preview";
|
||||
import { createCheckerboardRenderer } from "./checkerboard";
|
||||
@@ -64,7 +65,11 @@ export function createRenderer(canvas: HTMLCanvasElement, backend: RendererBacke
|
||||
for (const artboard of frame.document.artboards) {
|
||||
if (artboard.visible) renderArtboard(rendererContext, artboard, frame.editor.viewport, checkerboardRenderer);
|
||||
}
|
||||
imageTextureRenderer.syncAssets([...frame.document.assets, ...generationCandidatePreviewAssets(frame.editor)]);
|
||||
imageTextureRenderer.syncAssets([
|
||||
...frame.document.assets,
|
||||
...generationCandidatePreviewAssets(frame.editor),
|
||||
...textTextureHandles(frame.document),
|
||||
]);
|
||||
renderLayers(rendererContext, frame.document, frame.editor, imageTextureRenderer, adjustmentPass);
|
||||
|
||||
if (!frame.editor.maskEdit) {
|
||||
@@ -86,6 +91,13 @@ export function createRenderer(canvas: HTMLCanvasElement, backend: RendererBacke
|
||||
return renderer;
|
||||
}
|
||||
|
||||
function textTextureHandles(document: ImageDocument): Array<{ id: string }> {
|
||||
const index = createDocumentReadIndex(document);
|
||||
return [...index.layerById.values()]
|
||||
.filter((layer) => layer.type === "text")
|
||||
.map((layer) => ({ id: `text-render:${layer.id}` }));
|
||||
}
|
||||
|
||||
function createOptionalBrushPreviewRenderer(context: WebGlRendererContext) {
|
||||
try {
|
||||
return createBrushPreviewRenderer(context);
|
||||
|
||||
Reference in New Issue
Block a user