fix: 缩放的屏幕,灯条颜色预览效果错误
This commit is contained in:
@ -45,19 +45,19 @@ export const DisplayView: Component<DisplayViewProps> = (props) => {
|
||||
class="absolute bg-slate-50/10 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded backdrop-blur w-1/3 min-w-[300px] text-black"
|
||||
/>
|
||||
<LedStripPart
|
||||
class="row-start-1 col-start-2 flex-row"
|
||||
class="row-start-1 col-start-2 flex-row overflow-hidden"
|
||||
config={ledStripConfigs().find((c) => c.border === 'Top')}
|
||||
/>
|
||||
<LedStripPart
|
||||
class="row-start-2 col-start-1 flex-col"
|
||||
class="row-start-2 col-start-1 flex-col overflow-hidden"
|
||||
config={ledStripConfigs().find((c) => c.border === 'Left')}
|
||||
/>
|
||||
<LedStripPart
|
||||
class="row-start-2 col-start-3 flex-col"
|
||||
class="row-start-2 col-start-3 flex-col overflow-hidden"
|
||||
config={ledStripConfigs().find((c) => c.border === 'Right')}
|
||||
/>
|
||||
<LedStripPart
|
||||
class="row-start-3 col-start-2 flex-row"
|
||||
class="row-start-3 col-start-2 flex-row overflow-hidden"
|
||||
config={ledStripConfigs().find((c) => c.border === 'Bottom')}
|
||||
/>
|
||||
</section>
|
||||
|
@ -34,10 +34,14 @@ export const Pixel: Component<PixelProps> = (props) => {
|
||||
}));
|
||||
return (
|
||||
<div
|
||||
class="inline-block flex-shrink w-2 h-2 aspect-square rounded-full border border-black"
|
||||
style={style()}
|
||||
class="flex-auto flex h-full w-full justify-center items-center relative"
|
||||
title={props.color}
|
||||
/>
|
||||
>
|
||||
<div
|
||||
class="absolute top-px h-2 w-2 rounded-full shadow-2xl shadow-black"
|
||||
style={style()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@ -52,6 +56,7 @@ export const LedStripPart: Component<LedStripPartProps> = (props) => {
|
||||
if (!localProps.config || !samplePoints) {
|
||||
return;
|
||||
}
|
||||
|
||||
let pendingCount = 0;
|
||||
const unlisten = listen<{
|
||||
base64_image: string;
|
||||
@ -67,12 +72,6 @@ export const LedStripPart: Component<LedStripPartProps> = (props) => {
|
||||
}
|
||||
pendingCount++;
|
||||
|
||||
console.log({
|
||||
samplePoints,
|
||||
displayId: event.payload.display_id,
|
||||
border: localProps.config!.border,
|
||||
});
|
||||
|
||||
invoke<string[]>('get_one_edge_colors', {
|
||||
samplePoints,
|
||||
displayId: event.payload.display_id,
|
||||
@ -107,7 +106,6 @@ export const LedStripPart: Component<LedStripPartProps> = (props) => {
|
||||
if (_colors) {
|
||||
return <For each={_colors}>{(item) => <Pixel color={item} />}</For>;
|
||||
} else if (localProps.config) {
|
||||
return null;
|
||||
return (
|
||||
<For each={new Array(localProps.config.len).fill(undefined)}>
|
||||
{() => <Pixel color="transparent" />}
|
||||
|
Reference in New Issue
Block a user