-
Notifications
You must be signed in to change notification settings - Fork 0
Add per-layer globalCompositeOperation (blend modes) for Raster Layers #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
|
@copilot That works for merging and flattening layers, but it should also include the compositing operations in the normal rendering in CanvasEntityRendererModule.ts |
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
Added |
|
@copilot Seems like it isn't working correctly. The new code makes the layer completely disappear when certain boolean operations are selected, but other than that the functionality is the same as it was before: blend mode is only taking effect when layers are merged or composited together into a new layer, not when the canvas state is rendered or updated. |
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
Fixed by using CSS Now accesses the underlying canvas DOM element via Note: CSS mix-blend-mode supports the common blend modes (multiply, screen, overlay, etc.) but not boolean operations like 'destination-in' or 'source-atop' - those only work during merging/flattening via CanvasCompositorModule. Commit: af903ff |
|
@copilot the mix-blend-mode is creating interactions with the background now. Try using a parent container to apply isolation so that raster layers restrict their blend modes to each other. |
Co-authored-by: dunkeroni <3298737+dunkeroni@users.noreply.github.com>
Added The background layer is now isolated, so blend modes on layers above it only affect how those layers blend with each other, not with the background pattern/grid. Commit: dcff857 |
globalCompositeOperationproperty toCanvasRasterLayerStatetype in types.tsCanvasCompositorModule.tsto use per-layer composite operation when drawing each adapterRasterLayerMenuItems.tsxto toggle composite operation visibilitycanvasSlice.tsfor managing composite operation settingsCanvasEntityAdapterRasterLayer.tsto handle globalCompositeOperation in hashable stateLatest Fix
Added
isolation: isolateCSS property to the background layer's canvas element. This creates a new stacking context that prevents raster/control layers'mix-blend-modefrom blending with the background.How it works:
style.isolation = 'isolate'mix-blend-modewill only blend with each other, not with the backgroundChanges:
CanvasBackgroundModule.initialize()to set CSS isolation on the background canvas elementmix-blend-modeas beforeOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.