fix(know-your-world): raise auto-zoom thresholds for tiny regions
Increase the max acceptance thresholds so sub-pixel regions like Gibraltar, Vatican City, and Monaco get maximum zoom instead of being rejected: - Sub-pixel (<1px): 2-8% → 2-40% (allows 1000x zoom) - Tiny (1-5px): 5-15% → 5-25% - Normal small: 10-25% → 10-30% Previously, at 1000x zoom a 0.08px region would occupy ~20% of the magnifier, exceeding the 8% max threshold. The algorithm would then step DOWN trying to find a zoom where it fits within 2-8%, making tiny regions harder to select. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
e4c35e9425
commit
17c113e68b
|
|
@ -101,15 +101,18 @@ export function calculateAdaptiveThresholds(smallestSize: number): {
|
|||
max: number
|
||||
} {
|
||||
if (smallestSize < 1) {
|
||||
// Sub-pixel regions: accept 2-8% of magnifier
|
||||
return { min: 0.02, max: 0.08 }
|
||||
// Sub-pixel regions (Gibraltar at 0.08px, Vatican, Monaco):
|
||||
// These are so small that we want maximum zoom. Accept anything from 2% up to 40%.
|
||||
// At 1000x zoom, a 0.08px region becomes 80px in a ~400px magnifier = 20%.
|
||||
// We want to accept this rather than stepping down to lower zoom.
|
||||
return { min: 0.02, max: 0.4 }
|
||||
}
|
||||
if (smallestSize < 5) {
|
||||
// Tiny regions (1-5px): accept 5-15% of magnifier
|
||||
return { min: 0.05, max: 0.15 }
|
||||
// Tiny regions (1-5px): accept 5-25% of magnifier
|
||||
return { min: 0.05, max: 0.25 }
|
||||
}
|
||||
// Normal small regions: accept 10-25% of magnifier
|
||||
return { min: 0.1, max: 0.25 }
|
||||
// Normal small regions: accept 10-30% of magnifier
|
||||
return { min: 0.1, max: 0.3 }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue