Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

UI test: Library single click at 1x and 1.5x (#142)

islandmed25e6987cb9b6
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ffe7a2e6..efde848a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -901,6 +901,8 @@ if(SCULPTFORGE_BUILD_TESTS)
sculptforge_ui_test(size_popup_scaled size_popup --size 2400x1350)
# The stroke popup on a UI scaled 1.5x: it opens under the cursor and its items are where they're drawn.
sculptforge_ui_test(stroke_popup_scaled stroke_popup --size 2400x1350)
+ # Library single click (#142) on a UI scaled 1.5x: tiles still take one click.
+ sculptforge_ui_test(library_click_scaled library_click --size 2400x1350)
# UI scale (#87) at 1600x900, where Automatic in a test is exactly 100 %; label "dpi": release.sh step check runs them before the tag.
sculptforge_ui_test(ui_scale_900 ui_scale --size 1600x900)
set_tests_properties(ui_ui_scale_900 PROPERTIES LABELS "ui;dpi" TIMEOUT 300)
diff --git a/tests/ui/library_click.sfui b/tests/ui/library_click.sfui
new file mode 100644
index 00000000..07f2b5ae
--- /dev/null
+++ b/tests/ui/library_click.sfui
@@ -0,0 +1,34 @@
+# Library (#142): a single click uses a brush, alpha or material; a double-click still works and applies once;
+# a model still needs a double-click (a click only selects it). Also run on a UI scaled 1.5x (library_click_scaled).
+run new_plane resolution=8
+expect_value triangles == 128
+key ,
+expect_value library_open == 1
+
+click "Library/Tool"
+expect "Library/Sphere"
+click "Library/Sphere"
+expect_value triangles == 128 # a click selects a model, it does not replace the scene
+
+click "Library/Material"
+expect "Library/Chrome"
+click "Library/Chrome"
+expect_status Material: Chrome
+double_click "Library/Bronze"
+expect_status Material: Bronze
+wait_idle 60
+shot library-click-material
+
+click "Library/Brush"
+expect "Library/Clay"
+click "Library/Clay"
+expect_status Brush: Clay
+wait_idle 60
+shot library-click-brush
+
+click "Library/Alpha"
+expect "Library/Square"
+click "Library/Square"
+expect_status Alpha 'Square'
+wait_idle 60
+shot library-click-alpha