mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 01:57:41 +02:00
Merge pull request #1440 from Person2099/fix/filament-override-ams-mapping-dispatch
fix: compute AMS mapping from force-colour overrides when 3MF reqs unavailable
This commit is contained in:
@@ -200,7 +200,7 @@ describe('dual-color / tri-color hard-split bars (#1154 follow-up)', () => {
|
||||
describe('Sparkle prominence + checkerboard density (#1154 follow-up cosmetic)', () => {
|
||||
it('renders dense sparkle on card preset (at least 10 dots)', () => {
|
||||
// The original Sparkle pattern was 4 dots — too subtle on a 200×60px
|
||||
// banner. Now we use situation-aware dot counts: more dots for larger presets.
|
||||
// banner. Now we use situation-aware dot counts: more dots for larger presets.
|
||||
// Verify the card preset produces a dense pattern with at least 10 dots.
|
||||
render(<FilamentSwatch rgba="ff0000ff" effectType="sparkle" effectSize="card" />);
|
||||
const el = screen.getByTestId('filament-swatch');
|
||||
|
||||
@@ -106,7 +106,7 @@ export const EFFECT_OVERLAYS: Partial<
|
||||
Record<FilamentEffect, (effectSeed?: number, effectSize?: SwatchType) => EffectLayer>
|
||||
> = {
|
||||
// Sparkle: bright flecks — positions seeded from spool color+extracolors+subtype+effectType.
|
||||
// to give identical spools the same sparkle pattern while different spools get different patterns.
|
||||
// to give identical spools the same sparkle pattern while different spools get different patterns.
|
||||
sparkle: (spoolSeed = 0, effectSize = 'table') => {
|
||||
const rand = random_mulberry32(spoolSeed);
|
||||
const preset = SWATCH_TYPE_PRESETS[effectSize] ?? SWATCH_TYPE_PRESETS.table;
|
||||
|
||||
@@ -3,7 +3,7 @@ const FNV1A_32_PRIME = 0x01000193;
|
||||
|
||||
/**
|
||||
* Computes a fast 32-bit FNV-1a hash for deterministic, non-security tasks.
|
||||
* Accepts any number of string/nullable-string inputs, takes measurements
|
||||
* Accepts any number of string/nullable-string inputs, takes measurements
|
||||
* to avoid collisions, and combines them into a 32-bit hash.
|
||||
* Not cryptographically secure; use only for non-security-related use cases.
|
||||
*/
|
||||
@@ -38,7 +38,7 @@ export interface Mulberry32Sequence {
|
||||
|
||||
/**
|
||||
* Creates a fast deterministic PRNG sequence using Mulberry32.
|
||||
* Same seed will always produce the same sequence.
|
||||
* Same seed will always produce the same sequence.
|
||||
* Not cryptographically secure; use only for non-security-related use cases.
|
||||
*/
|
||||
export function random_mulberry32(seed: number): Mulberry32Sequence {
|
||||
|
||||
Reference in New Issue
Block a user