From 73916b50ee52e16dcc61da98a148bf7ab5a0d6bf Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:58:22 -0500 Subject: [PATCH] test container height --- pkg/justified-layout-wasm.d.ts | 28 -------- pkg/justified-layout-wasm.js | 4 -- pkg/justified-layout-wasm_bg.js | 93 ------------------------- pkg/justified-layout-wasm_bg.wasm | Bin 17456 -> 0 bytes pkg/justified-layout-wasm_bg.wasm.d.ts | 7 -- tests/lib.rs | 24 +++++++ 6 files changed, 24 insertions(+), 132 deletions(-) delete mode 100644 pkg/justified-layout-wasm.d.ts delete mode 100644 pkg/justified-layout-wasm.js delete mode 100644 pkg/justified-layout-wasm_bg.js delete mode 100644 pkg/justified-layout-wasm_bg.wasm delete mode 100644 pkg/justified-layout-wasm_bg.wasm.d.ts diff --git a/pkg/justified-layout-wasm.d.ts b/pkg/justified-layout-wasm.d.ts deleted file mode 100644 index b578df7..0000000 --- a/pkg/justified-layout-wasm.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Given an input of aspect ratios representing boxes, returns a vector 4 times its length + 4. - * The first element is the maximum width across all rows, the second is the total height required - * to display all rows, the next two are padding, and the remaining elements are sequences of 4 - * elements for each box, representing the top, left, width and height positions. - * `row_height` is a positive float that is the target height of the row. - * It is not strictly followed; the actual height may be off by one due to truncation, and may be - * substantially different if only one box can fit on a row and this box cannot fit with the - * target height. The height cannot exceed this target unless `tolerance` is greater than zero. - * `row_width` is a positive float that is the target width of the row. - * It will not be exceeded, but a row may have a shorter width if the boxes cannot fill the row - * width given the `tolerance`. Additionally, as the positions are in floats, - * rounding them to integers may yield a very slightly different width. - * `spacing` is a non-negative float that controls the spacing between boxes, including between rows. - * Notably, there is no offset applied in directions where there is no box. - * The first box will have its top and left positions both at 0, not at `spacing`, and so on. - * `tolerance` is a non-negative float that gives more freedom to fill the row width. - * When there is free space in the row and the next box cannot fit in this row, it can scale - * the boxes to a larger height to fill this space while respecting aspect ratios. A value of - * 0.15 signifies that the actual row height may be up to 15% greater than the target height. - * - * Note: The response being Vec rather than a struct or list of structs is important, as the - * JS-WASM interop is *massively* slower when moving structs to JS instead of an array and - * importing integers is faster than floats. - */ -export function get_justified_layout(aspect_ratios: Float32Array, row_height: number, row_width: number, spacing: number, tolerance: number): Int32Array; diff --git a/pkg/justified-layout-wasm.js b/pkg/justified-layout-wasm.js deleted file mode 100644 index b0adfa3..0000000 --- a/pkg/justified-layout-wasm.js +++ /dev/null @@ -1,4 +0,0 @@ -import * as wasm from "./justified-layout-wasm_bg.wasm"; -export * from "./justified-layout-wasm_bg.js"; -import { __wbg_set_wasm } from "./justified-layout-wasm_bg.js"; -__wbg_set_wasm(wasm); \ No newline at end of file diff --git a/pkg/justified-layout-wasm_bg.js b/pkg/justified-layout-wasm_bg.js deleted file mode 100644 index d805114..0000000 --- a/pkg/justified-layout-wasm_bg.js +++ /dev/null @@ -1,93 +0,0 @@ -let wasm; -export function __wbg_set_wasm(val) { - wasm = val; -} - - -let cachedFloat32ArrayMemory0 = null; - -function getFloat32ArrayMemory0() { - if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) { - cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer); - } - return cachedFloat32ArrayMemory0; -} - -let WASM_VECTOR_LEN = 0; - -function passArrayF32ToWasm0(arg, malloc) { - const ptr = malloc(arg.length * 4, 4) >>> 0; - getFloat32ArrayMemory0().set(arg, ptr / 4); - WASM_VECTOR_LEN = arg.length; - return ptr; -} - -let cachedDataViewMemory0 = null; - -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - -let cachedInt32ArrayMemory0 = null; - -function getInt32ArrayMemory0() { - if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) { - cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer); - } - return cachedInt32ArrayMemory0; -} - -function getArrayI32FromWasm0(ptr, len) { - ptr = ptr >>> 0; - return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); -} -/** - * Given an input of aspect ratios representing boxes, returns a vector 4 times its length + 4. - * The first element is the maximum width across all rows, the second is the total height required - * to display all rows, the next two are padding, and the remaining elements are sequences of 4 - * elements for each box, representing the top, left, width and height positions. - * `row_height` is a positive float that is the target height of the row. - * It is not strictly followed; the actual height may be off by one due to truncation, and may be - * substantially different if only one box can fit on a row and this box cannot fit with the - * target height. The height cannot exceed this target unless `tolerance` is greater than zero. - * `row_width` is a positive float that is the target width of the row. - * It will not be exceeded, but a row may have a shorter width if the boxes cannot fill the row - * width given the `tolerance`. Additionally, as the positions are in floats, - * rounding them to integers may yield a very slightly different width. - * `spacing` is a non-negative float that controls the spacing between boxes, including between rows. - * Notably, there is no offset applied in directions where there is no box. - * The first box will have its top and left positions both at 0, not at `spacing`, and so on. - * `tolerance` is a non-negative float that gives more freedom to fill the row width. - * When there is free space in the row and the next box cannot fit in this row, it can scale - * the boxes to a larger height to fill this space while respecting aspect ratios. A value of - * 0.15 signifies that the actual row height may be up to 15% greater than the target height. - * - * Note: The response being Vec rather than a struct or list of structs is important, as the - * JS-WASM interop is *massively* slower when moving structs to JS instead of an array and - * importing integers is faster than floats. - * @param {Float32Array} aspect_ratios - * @param {number} row_height - * @param {number} row_width - * @param {number} spacing - * @param {number} tolerance - * @returns {Int32Array} - */ -export function get_justified_layout(aspect_ratios, row_height, row_width, spacing, tolerance) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passArrayF32ToWasm0(aspect_ratios, wasm.__wbindgen_export_0); - const len0 = WASM_VECTOR_LEN; - wasm.get_justified_layout(retptr, ptr0, len0, row_height, row_width, spacing, tolerance); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var v2 = getArrayI32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_1(r0, r1 * 4, 4); - return v2; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } -} - diff --git a/pkg/justified-layout-wasm_bg.wasm b/pkg/justified-layout-wasm_bg.wasm deleted file mode 100644 index 3e51aef49e8b10a7ed9d97b338b4937832676283..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17456 zcmchfTZ~=TdEeK*oZFmp$U};fC=MyEy~Q+?C5m&Op`0e%N<@Vr7^Qv5L#omva!Ae@ zaz=9zMKzAeG;AwWa%w1Q5fpk50;3iRB{fh#xPTrQKt)_sZCoI24b%??YM=(H0t%o4 zY9U7b{lB&MIcJ8Hq98^^%&hxb-}>&~xAw>_ZeER?bJ5SWz7pTK;l7gGxN#%8p*p|S za9@d3O{uDk=%}eq+2HqY@t;c`e=My<^~lBiOOv?KOk$U?t8=y3)#HRloFs9Qa+G80 z3(?-awIp(T>MeFJZr;4@+KshZ{p!-ywT+i!x9`%@*17(Rn_J5lmzOS_yR!K5+KXFm z*Wq*LUV46c^}?m4)pLs%E}Yw1JGZ&Dcz)&F3v0`(TT2`6Z`?OBW9j+}Ya3hVCfq~! z=$&+jTMtIAh}wIO+&6xIv-jxH>;eC?Dw#1*}jymiFIH{z4S zf8G`UJ9;)fSvYF{;nUxIw%a&Bt=-R~;`(}4E8hAix82d$<;|zNX>mAfFtN6hCCvHg z(@z^`)04hd)O}PmuU*RB%C#a|XDHfQDSp16HQK&W#9PI!*KWJMHi@3rNtx@!Z51qi zh#Aqf6?SbDho2eW%F+brd~`HUIX|!a+Uc(I6f4w|XQ@Y7?CW{bb?lJPa-FoT`TLll znUPP6L)VIQySNv@w`?f*K&6a zEF|lxK~&t>w9EDLdXa49u6X0?+$v95@TO{ZzoT(8Po4oOiBIR^j!%6u7dNZ3d|Z6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(a: number) => number; -export const __wbindgen_export_0: (a: number, b: number) => number; -export const __wbindgen_export_1: (a: number, b: number, c: number) => void; diff --git a/tests/lib.rs b/tests/lib.rs index eab99b6..2a0aa5a 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -69,6 +69,9 @@ fn applies_spacing() { let max_row_width = layout[0]; assert_eq!(max_row_width, 904); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 300); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -113,6 +116,9 @@ fn expands_row_based_on_height_tolerance() { let max_row_width = layout[0]; assert_eq!(max_row_width, 994); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 330); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -157,6 +163,9 @@ fn adds_second_row_due_to_spacing() { let max_row_width = layout[0]; assert_eq!(max_row_width, 602); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 602); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -201,6 +210,9 @@ fn positions_boxes_with_different_aspect_ratios() { let max_row_width = layout[0]; assert_eq!(max_row_width, 771); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 602); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -245,6 +257,9 @@ fn scales_boxes_with_different_aspect_ratios_when_using_height_tolerance() { let max_row_width = layout[0]; assert_eq!(max_row_width, 900); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 712); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -289,6 +304,9 @@ fn one_square_box_on_each_row() { let max_row_width = layout[0]; assert_eq!(max_row_width, 300); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 904); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -333,6 +351,9 @@ fn different_shaped_boxes_on_each_row() { let max_row_width = layout[0]; assert_eq!(max_row_width, 600); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 904); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() }; @@ -377,6 +398,9 @@ fn one_box_on_each_row_with_scaling() { let max_row_width = layout[0]; assert_eq!(max_row_width, 600); + let max_row_height = layout[1]; + assert_eq!(max_row_height, 337 + 2 + 300 + 2 + 345); + let [top1, left1, width1, height1] = layout[4..8] else { unreachable!() };