Workers P2: Sichtprüfung im Browser – Schilder über den Figuren, Raumtitel über den Möbeln, Zoomknöpfe unten, Abstand der Meldung
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d67f8cc471
commit
820ccd510d
9 files changed
+122
-21
No files matched your search
@@ -63,6 +63,23 @@ test('label: Zahl wird zu Text, Hintergrund folgt der Ausrichtung', () => {
|
||||
assert.deepEqual([c.rects[0].x, c.rects[0].y, c.rects[0].w, c.rects[0].h, c.rects[0].fill], [12, 13, 36, 17, '#ffffff'])
|
||||
assert.equal(c.texts[0].x, 30)
|
||||
})
|
||||
test('label: halo zeichnet erst einen hellen Rand (strokeText), dann den Text darüber; ohne halo kein Rand', () => {
|
||||
const h = makeCtx()
|
||||
S.setGrid(h.ctx, { k: 3 })
|
||||
S.label(h.ctx, 'Mail-Stube', 2, 1, { size: 10, color: '#445566', halo: '#ffffff' })
|
||||
assert.equal(h.strokes.length, 1)
|
||||
assert.deepEqual([h.strokes[0].text, h.strokes[0].style], ['Mail-Stube', '#ffffff'])
|
||||
assert.deepEqual([h.strokes[0].x, h.strokes[0].y], [h.texts[0].x, h.texts[0].y], 'Rand und Text an derselben Stelle')
|
||||
assert.equal(h.strokes[0].texts, 0, 'der Rand kommt vor dem Text')
|
||||
assert.ok(h.strokes[0].width >= 2, 'mindestens ein Geräte-Pixel Rand rundum')
|
||||
const big = makeCtx()
|
||||
S.setGrid(big.ctx, { k: 6 })
|
||||
S.label(big.ctx, 'Mail-Stube', 2, 1, { size: 10, halo: '#ffffff' })
|
||||
assert.ok(big.strokes[0].width > h.strokes[0].width, 'der Rand wächst mit dem Raster')
|
||||
const plain = makeCtx()
|
||||
S.label(plain.ctx, 'Mail-Stube', 2, 1, { size: 10 })
|
||||
assert.equal(plain.strokes.length, 0)
|
||||
})
|
||||
test('drawWorker: Schlafen zeigt ein z über dem Hut, das mit t steigt; stehen nicht', () => {
|
||||
const zs = (pose, t) => {
|
||||
const { ctx, rects } = makeCtx()
|
||||
|
||||
Reference in new issue
Block a user