stash
This commit is contained in:
parent
18a3e40435
commit
15dad8e3be
6 changed files with 130 additions and 153 deletions
|
|
@ -249,8 +249,8 @@ function positionTree(node, ownAxis, x, y) {
|
|||
// MIN_RECOMMENDED_QR_PX_PER_MODULE/MIN_RECOMMENDED_QR_MODULE_MM the leaf falls short of (still
|
||||
// printable, just flagged as a scan-reliability risk), and unconditionally appends its raw
|
||||
// {scale, moduleMm} to `qrInfo` - callers needing to show those numbers regardless of whether
|
||||
// they tripped a threshold (see LabelLayoutPreview.vue's debug line) shouldn't have to re-derive
|
||||
// them. See docs/implementation.md#crisp-qr-sizing.
|
||||
// they tripped a threshold shouldn't have to re-derive them. See
|
||||
// docs/implementation.md#crisp-qr-sizing.
|
||||
function snapQrToCrispSize(node, pxPerMm, warnings, qrInfo) {
|
||||
if (isSplit(node)) {
|
||||
node.forEach(child => snapQrToCrispSize(child, pxPerMm, warnings, qrInfo));
|
||||
|
|
@ -349,7 +349,7 @@ function measureTextBlock(ctx, lines, referencePx) {
|
|||
return {width, height};
|
||||
}
|
||||
|
||||
// Converts a resolved content tree (see templateContent) into one ready for layout. See
|
||||
// Converts a resolved content tree (see label-layouts.js's resolveContent) into one ready for layout. See
|
||||
// docs/implementation.md#render-tree-construction.
|
||||
function buildRenderTree(ctx, node, referencePx) {
|
||||
if (isSplit(node)) {
|
||||
|
|
@ -483,7 +483,7 @@ function layoutContent(ctx, content, fixedSize, maxLength, referencePx, pxPerMm,
|
|||
return {tree, length, warnings, qrInfo, textInfo};
|
||||
}
|
||||
|
||||
// The tape-fed layout: draws a fully resolved content tree (see templateContent) at the tape's
|
||||
// The tape-fed layout: draws a fully resolved content tree (see label-layouts.js's resolveContent) at the tape's
|
||||
// real pixel dimensions. See docs/implementation.md#tape-fed-label-drawing. Returns
|
||||
// {textSizesPx}: each "text" leaf's effective font size, in the tree's own left-to-right,
|
||||
// top-to-bottom order; {warnings}: {short, message} scan-reliability entries from
|
||||
|
|
@ -602,7 +602,7 @@ function splitUserHandle(userHandle) {
|
|||
|
||||
// Seeds label-layouts.js's BASE_VARS, keyed by `kind`; derived vars (userHandle, itemUrl, …) are
|
||||
// computed live elsewhere (see DERIVED_VARS, Print.vue's `shortUrl`), and omitting a field
|
||||
// (rather than leaving it present-but-empty) signals "not available" to templateIsAvailable.
|
||||
// (rather than leaving it present-but-empty) signals "not available" to contentIsAvailable.
|
||||
const LABEL_FIELD_BUILDERS = {
|
||||
"item": ({userHandle, item}) => {
|
||||
const split = splitUserHandle(userHandle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue