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.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Preferences > Tablet: Troubleshooting wraps below the pressure line when it doesn't fit (200% UI scale); past_right:WINDOW test query, checked at 100% and 200%
islandmeda989a29582e6
diff --git a/changes/fix-pen-ui-clicks-orbit.md b/changes/fix-pen-ui-clicks-orbit.mdindex 3f271f7c..648fc0dd 100644--- a/changes/fix-pen-ui-clicks-orbit.md+++ b/changes/fix-pen-ui-clicks-orbit.md@@ -21,3 +21,6 @@ fixed on main after the report (10-31 to 11-02); tests/ui/pen_quick_taps.sfui re(new `pen_tap` verb). Orbit: SDL 3.2.30 gives pen and mouse in the same window pixels (per-monitor DPI aware, norelative mode), and the test proves the same drag turns the view by the same angle with either; the difference is thetablet's absolute mapping, hence the setting.+Also: Preferences > Tablet's Troubleshooting button moves below "Pressure: ..." when it doesn't fit beside it (it was+cut off at 200% UI scale); tests/ui/tablet_view_speed.sfui checks with `past_right:Tablet` (new query: items of a+pushScope panel past their window's inner right edge) at 100% and 200%, 1440x900 and 1024x768.diff --git a/src/app/Demo.cpp b/src/app/Demo.cppindex 26246f91..3c8ae13f 100644--- a/src/app/Demo.cpp+++ b/src/app/Demo.cpp@@ -44,6 +44,9 @@ struct ItemTable {std::vector<std::string> scopes; // Demo::pushScope: panels drawn inside the shell's trays and drop-downs// Items whose visible part runs past the window's edge this frame (#105): "window/label".std::map<ImGuiID, std::string> offscreen;+ // Items that run past their window's inner right edge, scrollable or not (a button cut off at a panel's edge):+ // "window/label" by ID, the window without its "##" part.+ std::map<ImGuiID, std::string> pastRight;};ItemTable& items() {static ItemTable t;@@ -72,6 +75,12 @@ void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bbif (bb.GetWidth() > 1.0f && bb.GetHeight() > 1.0f && ((outX && !scrollX) || (outY && !scrollY) || (offScreen && !scrollX && !scrollY)))items().offscreen[id] = std::string(win->RootWindow->Name) + "/(unlabelled at " + std::to_string(int(bb.Min.x)) +"," + std::to_string(int(bb.Min.y)) + ")";+ if (!win->ScrollbarX && bb.GetWidth() > 1.0f && bb.Max.x > win->InnerRect.Max.x + 1.0f) {+ std::string root = win->RootWindow->Name; // (in a pushScope panel: the panel's name)+ if (const size_t hash = root.find("##"); hash != std::string::npos) root.resize(hash);+ if (!items().scopes.empty()) root = items().scopes.back();+ items().pastRight[id] = root + "/(unlabelled at " + std::to_string(int(bb.Min.x)) + "," + std::to_string(int(bb.Min.y)) + ")";+ }clip.ClipWith(ImRect(ImVec2(0, 0), ctx->IO.DisplaySize));}items().rects[id] = {bb, clip};@@ -90,6 +99,8 @@ void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* labstd::string window = ctx && ctx->CurrentWindow ? ctx->CurrentWindow->RootWindow->Name : "";if (auto off = items().offscreen.find(id); off != items().offscreen.end()) off->second = window + "/" + text;if (const size_t hash = window.find("##"); hash != std::string::npos) window.resize(hash);+ if (auto past = items().pastRight.find(id); past != items().pastRight.end())+ past->second = (items().scopes.empty() ? window : items().scopes.back()) + "/" + text;auto add = [&](const std::string& key) {items().byLabel[key] = it->second;if (!window.empty()) items().byLabel[window + "/" + key] = it->second;@@ -139,6 +150,7 @@ void resetDemoGlobals() { items() = {}; }void Demo::beginFrame() {items().byLabel.clear();items().offscreen.clear();+ items().pastRight.clear();items().frame.clear();items().scopes.clear();}@@ -168,6 +180,13 @@ std::vector<std::string> Demo::offscreenItems() {return out;}+std::vector<std::string> Demo::pastRightEdge(const std::string& window) {+ std::vector<std::string> out;+ for (const auto& [id, name] : items().pastRight)+ if (name.compare(0, window.size() + 1, window + "/") == 0) out.push_back(name);+ return out;+}+bool Demo::findItem(const std::string& label, ImVec2& center, bool* visible, ImVec4* clipOut) const {auto found = [&](const Placed& p) {center = p.rect.GetCenter();diff --git a/src/app/Demo.h b/src/app/Demo.hindex b5d906eb..c960db33 100644--- a/src/app/Demo.h+++ b/src/app/Demo.h@@ -58,6 +58,8 @@ public:static void popScope();static std::vector<std::string> similarItems(const std::string& label); // for test failure messagesstatic std::vector<std::string> offscreenItems(); // items drawn past the window's edge last frame ("window/label")+ // Items in WINDOW (its name before "##") that ran past its inner right edge last frame, scrollable or not.+ static std::vector<std::string> pastRightEdge(const std::string& window);// UI tests (UiTest.cpp). Steps that fail stop the run; failures() lists why.bool loadScript(const std::string& path, std::string& error);diff --git a/src/app/Palettes.cpp b/src/app/Palettes.cppindex 86ffbb20..05357bc8 100644--- a/src/app/Palettes.cpp+++ b/src/app/Palettes.cpp@@ -692,7 +692,9 @@ void App::drawPalette_Preferences() {}if (subpalette("preferences.tablet", "Tablet")) {tray::Section section;+ Demo::pushScope("Tablet"); // (UI tests: past_right:Tablet)drawTabletSection();+ Demo::popScope();}if (subpalette("preferences.performance", "Performance")) {tray::Section section;diff --git a/src/app/Tablet.cpp b/src/app/Tablet.cppindex 8afc3450..d409d7c4 100644--- a/src/app/Tablet.cpp+++ b/src/app/Tablet.cpp@@ -362,8 +362,13 @@ const char* App::pressureStatus() const {void App::drawPressureStatus() {const bool ok = penSeen_ && penTracker_.hasPressure();ImGui::TextColored(col(ok ? ui::color::accent : ui::color::textDim), "%s", tr(pressureStatus()));+ // Troubleshooting beside it, or on its own line where it would run past the panel (200% UI scale, narrow trays).+ const char* help = tr(ICON_LC_CIRCLE_HELP " Troubleshooting##pressure_help");+ const ImGuiStyle& st = ImGui::GetStyle();+ const float helpW = ImGui::CalcTextSize(help, nullptr, true).x + st.FramePadding.x * 2.0f;ImGui::SameLine();- if (ImGui::SmallButton(tr(ICON_LC_CIRCLE_HELP " Troubleshooting##pressure_help")))+ if (ImGui::GetContentRegionAvail().x < helpW) ImGui::NewLine();+ if (ImGui::SmallButton(help))guide_.open("troubleshooting.md#pen-tablets");#if defined(_WIN32)ui::HelpText("Pressure", nullptr,diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cppindex 68ae6812..aedb683b 100644--- a/src/app/UiTest.cpp+++ b/src/app/UiTest.cpp@@ -961,6 +961,11 @@ double Demo::query(const std::string& name, bool& known) const {for (const std::string& o : off) std::fprintf(stderr, "offscreen: %s\n", o.c_str());return double(off.size());}+ if (name.compare(0, 11, "past_right:") == 0) { // past_right:WINDOW: its items cut off at its right edge last frame+ const std::vector<std::string> past = Demo::pastRightEdge(name.substr(11));+ for (const std::string& p : past) std::fprintf(stderr, "past right edge: %s\n", p.c_str());+ return double(past.size());+ }if (name == "library_open") return app_.libraryBrowser_.open() ? 1.0 : 0.0;if (name == "guide_open") return app_.guide_.isOpen() ? 1.0 : 0.0;if (name == "guide_hits") return double(app_.guide_.searchHits());diff --git a/tests/ui/tablet_view_speed.sfui b/tests/ui/tablet_view_speed.sfuiindex bd803e85..f7f82539 100644--- a/tests/ui/tablet_view_speed.sfui+++ b/tests/ui/tablet_view_speed.sfui@@ -1,5 +1,6 @@# Preferences > Tablet > View speed (the pen's own orbit, pan and zoom speed): the row fits and reads at 100% and-# 200% UI scale, and in narrow windows (CMake also runs it at 1440x900 and 1024x768).+# 200% UI scale, nothing in the Tablet section runs past the panel's right edge, and the same in narrow windows+# (CMake also runs it at 1440x900 and 1024x768).run ui_look look=classic layout=classic # (Preferences on the palette bar, as tablet.sfui)run new_sphere subdivisions=3click "Preferences##palette.preferences"@@ -8,6 +9,7 @@ expect "##tablet_view_speed"expect_value tablet_view_speed == 1expect_text View speed 1.00shot tablet-100+expect_value past_right:Tablet == 0 # (nothing in the section is cut off at the panel's edge)key escapeui_scale 200wait 0.3@@ -15,3 +17,4 @@ click "Preferences##palette.preferences" # (Tablet stays open: clicking it agahover "##tablet_view_speed" # (scrolls the panel to it in short windows)expect_text View speed 1.00shot tablet-200+expect_value past_right:Tablet == 0 # (Troubleshooting wraps below the pressure line)