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.

Gizmo size (Small / Medium / Large) and the View Figure in Draw > Camera

islandmedfc8ae1727e12
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f29c9447..8da67c1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,12 @@ All notable changes to SculptForge are listed here. The format follows
## [Unreleased]
+### Added
+- **Gizmo size** (Draw > Camera): the corner axes come in Small, Medium (as before, the default) and Large, on top
+ of the UI scale; clicking an end still snaps to that side at every size. Saved in the preferences.
+- **View Figure** (Draw > Camera, beside Axes, off by default): a small shaded head in the canvas corner that turns
+ with the camera; click it to snap to the nearest side view. Requested on Discord.
+
## [0.10.7] - 2026-11-01
### Changed
diff --git a/docs/guide/navigation.md b/docs/guide/navigation.md
index 2e6fc9f1..0a2edbd9 100644
--- a/docs/guide/navigation.md
+++ b/docs/guide/navigation.md
@@ -22,6 +22,12 @@ sees them. Click an end to look from that side, as in Blender: **X** the right v
and the plain dot at the other end of each axis the left, bottom or back view. These are orthographic like the
numpad views. The end under the pointer gets a ring.
+**Draw > Camera > Gizmo size** makes the axes **Small**, **Medium** (the default) or **Large**; they grow with the
+UI scale too, and clicking an end works at every size. **View Figure** (beside **Axes**, off until you turn it on)
+adds a small shaded head in the corner that turns with the camera, so you can tell front from back at a glance.
+Click it to look from the nearest side: the front, back, left, right, top or bottom view, orthographic like the
+axes.
+
Navigation starts only on the canvas. A drag that begins on a shelf, a tray or a palette never moves the
camera.
diff --git a/docs/guide/whats-new.md b/docs/guide/whats-new.md
index 83a50cb8..a542ba84 100644
--- a/docs/guide/whats-new.md
+++ b/docs/guide/whats-new.md
@@ -5,6 +5,13 @@ chapter opens by itself the first time you start a new version; you can always f
**Help > What's New**. Every detail is in the
[changelog](https://github.com/islandmed/SculptForge/blob/main/CHANGELOG.md).
+## Version 0.10.8
+
+- **Smaller (or larger) corner axes**: **Draw > Camera > Gizmo size** sets Small, Medium or Large
+ ([Navigation](navigation.md)).
+- **View Figure**: turn it on beside **Axes** for a small head in the corner that turns with the view; click it to
+ snap to the nearest side.
+
## Version 0.10.7
- **A clearer membership card**: the three memberships side by side with what each one gets you, in your look's
diff --git a/src/app/App.cpp b/src/app/App.cpp
index 08c6194c..48c68bae 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -23,6 +23,7 @@
#include "core/EnginePresets.h"
#include "link/UnrealLink.h"
#include "core/BrushLibrary.h"
+#include "core/Benchmark.h"
#include "core/Decimate.h"
#include "core/ImageTo3D.h"
#include "core/Project.h"
@@ -2299,6 +2300,7 @@ void App::drawUi() {
drawSculptableOverlay(); // Make sculptable: crop box, face landmarks (PanelSculptable.cpp)
drawCaptureOverlay(); // Capture from view: the square, the result window (PanelKelvinlet.cpp)
if (uiPrefs_.showAxes) drawAxisGizmo(); // X / Y / Z in the canvas corner (#31)
+ if (uiPrefs_.showViewFigure) drawViewFigure();
drawAirStrokeIndicator(); // Start strokes off the model is on (#62, Input.cpp)
if (drag_ == Drag::Insert) { // the size the insert will get
insertPx_ = std::hypot(mouse.x - insertX_, mouse.y - insertY_);
@@ -3310,16 +3312,32 @@ bool App::drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col) {
std::array<AxisGizmoEnd, 6> App::axisGizmoLayout() const {
// Top left of the canvas, below the timeline strip when that is at the top (timelineTopInset_).
const CanvasRect canvas = canvasRect();
- const float s = 34.0f * uiScale_;
+ const float s = 34.0f * axisGizmoUnit();
return axisGizmoEnds(glm::mat3(camera_.view()),
glm::vec2(canvas.x + s + 18.0f * uiScale_, canvas.y + timelineTopInset_ + s + 18.0f * uiScale_), s);
}
+float App::axisGizmoUnit() const { return uiScale_ * axisGizmoScale(uiPrefs_.axisGizmoSize); }
+
+float App::viewFigureRadius() const { return 34.0f * axisGizmoUnit(); }
+
+glm::vec2 App::viewFigureCentre() const {
+ // In the axes' place when they are off, else just below them.
+ const CanvasRect canvas = canvasRect();
+ const float r = viewFigureRadius();
+ const float top = canvas.y + timelineTopInset_ + 18.0f * uiScale_;
+ const float below = uiPrefs_.showAxes ? 2.0f * 34.0f * axisGizmoUnit() + 14.0f * uiScale_ : 0.0f;
+ return glm::vec2(canvas.x + 18.0f * uiScale_ + 34.0f * axisGizmoUnit(), top + below + r);
+}
+
bool App::axisGizmoMouseDown(float x, float y) {
- // A click on an end snaps to that side view, orthographic (#43, as in Blender's navigation gizmo).
- if (!uiPrefs_.showAxes) return false;
+ // A click on an end snaps to that side view, orthographic (#43, as in Blender's navigation gizmo); a click on
+ // the View Figure to the side view nearest the current one.
const auto ends = axisGizmoLayout();
- const int hit = axisGizmoHit(ends, x, y, 9.0f * uiScale_);
+ int hit = uiPrefs_.showAxes ? axisGizmoHit(ends, x, y, 9.0f * axisGizmoUnit()) : -1;
+ if (hit < 0 && uiPrefs_.showViewFigure &&
+ glm::length(glm::vec2(x, y) - viewFigureCentre()) <= viewFigureRadius())
+ hit = axisGizmoFacing(ends);
if (hit < 0) return false;
if (const Action* a = actions_.find(axisGizmoView(ends[size_t(hit)].axis, ends[size_t(hit)].negative).action); a && a->run) a->run();
return true;
@@ -3330,10 +3348,11 @@ void App::drawAxisGizmo() {
// positive end and a plain one at the negative end; the ends pointing away are drawn first and dimmer. A click
// on an end snaps to that side (axisGizmoMouseDown); the end under the mouse gets a ring.
ImDrawList* dl = ImGui::GetBackgroundDrawList();
+ const float unit = axisGizmoUnit();
auto ends = axisGizmoLayout();
const glm::vec2 c = (ends[0].at + ends[3].at) * 0.5f;
const ImVec2 mouse = ImGui::GetIO().MousePos;
- const int hover = ImGui::GetIO().WantCaptureMouse ? -1 : axisGizmoHit(ends, mouse.x, mouse.y, 9.0f * uiScale_);
+ const int hover = ImGui::GetIO().WantCaptureMouse ? -1 : axisGizmoHit(ends, mouse.x, mouse.y, 9.0f * unit);
const AxisGizmoEnd hovered = hover >= 0 ? ends[size_t(hover)] : AxisGizmoEnd{};
std::sort(ends.begin(), ends.end(), [](const AxisGizmoEnd& a, const AxisGizmoEnd& b) { return a.depth < b.depth; });
static constexpr ImU32 colours[3] = {IM_COL32(230, 80, 80, 255), IM_COL32(110, 200, 90, 255), IM_COL32(80, 140, 240, 255)};
@@ -3342,14 +3361,63 @@ void App::drawAxisGizmo() {
const ImVec2 tip(e.at.x, e.at.y);
ImU32 col = e.depth < -0.2f ? (colours[e.axis] & 0x00ffffffu) | 0x90000000u : colours[e.axis];
if (e.negative) col = (col & 0xff000000u) | ((col & 0x00fefefeu) >> 1); // the negative end: darker
- else dl->AddLine(ImVec2(c.x, c.y), tip, col, 2.0f * uiScale_);
- dl->AddCircleFilled(tip, (e.negative ? 5.5f : 7.0f) * uiScale_, col);
+ else dl->AddLine(ImVec2(c.x, c.y), tip, col, 2.0f * unit);
+ dl->AddCircleFilled(tip, (e.negative ? 5.5f : 7.0f) * unit, col);
if (hover >= 0 && e.axis == hovered.axis && e.negative == hovered.negative)
- dl->AddCircle(tip, 9.0f * uiScale_, IM_COL32(255, 255, 255, 220), 0, 1.5f * uiScale_);
+ dl->AddCircle(tip, 9.0f * unit, IM_COL32(255, 255, 255, 220), 0, 1.5f * unit);
if (e.negative) continue;
- const ImVec2 ts = ImGui::CalcTextSize(names[e.axis]);
- dl->AddText(ImVec2(tip.x - ts.x * 0.5f, tip.y - ts.y * 0.5f), IM_COL32(20, 20, 22, 255), names[e.axis]);
+ // The letter shrinks with the ball (Small) but never grows past the UI font.
+ const float fontSize = ImGui::GetFontSize() * std::min(1.0f, unit / std::max(uiScale_, 0.01f));
+ const ImVec2 ts = ImGui::GetFont()->CalcTextSizeA(fontSize, FLT_MAX, 0.0f, names[e.axis]);
+ dl->AddText(ImGui::GetFont(), fontSize, ImVec2(tip.x - ts.x * 0.5f, tip.y - ts.y * 0.5f), IM_COL32(20, 20, 22, 255),
+ names[e.axis]);
+ }
+}
+
+void App::drawViewFigure() {
+ // A low-resolution copy of the benchmark's procedural head (our own formula, core/Benchmark.cpp), turned with
+ // the camera and shaded on the CPU into the background draw list: facing triangles only, far ones first. A
+ // click snaps to the nearest side view (axisGizmoMouseDown); a ring shows under the pointer.
+ static const Mesh head = makeBenchHead(3000);
+ static std::vector<std::pair<float, uint32_t>> order;
+ ImDrawList* dl = ImGui::GetBackgroundDrawList();
+ const glm::vec2 c = viewFigureCentre();
+ const float r = viewFigureRadius();
+ const float k = r / 1.25f; // the head with its neck is about 2.5 units tall
+ const glm::mat3 rot(camera_.view());
+ const glm::vec3 light = glm::normalize(glm::vec3(-0.45f, 0.6f, 0.75f));
+ order.clear();
+ for (uint32_t t = 0; t < uint32_t(head.triangles.size()); ++t) {
+ const glm::uvec3 f = head.triangles[t];
+ const glm::vec3 n = rot * (head.normals[f.x] + head.normals[f.y] + head.normals[f.z]);
+ if (n.z <= 0.0f) continue;
+ const float depth = (rot * (head.positions[f.x] + head.positions[f.y] + head.positions[f.z])).z;
+ order.emplace_back(depth, t);
+ }
+ std::sort(order.begin(), order.end());
+ auto at = [&](uint32_t v) {
+ const glm::vec3 p = rot * head.positions[v];
+ return ImVec2(c.x + p.x * k, c.y - p.y * k);
+ };
+ // Raw triangles with a colour per corner (smooth shading, no anti-aliasing fringe between triangles).
+ auto shade = [&](uint32_t v) {
+ const float lit = 0.22f + 0.78f * std::max(0.0f, glm::dot(glm::normalize(rot * head.normals[v]), light));
+ const int g = int(std::clamp(lit, 0.0f, 1.0f) * 205.0f + 30.0f);
+ return IM_COL32(g, std::min(255, g + 4), std::min(255, g + 12), 255);
+ };
+ const ImVec2 uv = ImGui::GetDrawListSharedData()->TexUvWhitePixel;
+ dl->PrimReserve(int(order.size()) * 3, int(order.size()) * 3);
+ for (const auto& [depth, t] : order) {
+ const glm::uvec3 f = head.triangles[t];
+ const ImDrawIdx base = ImDrawIdx(dl->_VtxCurrentIdx);
+ for (int i = 0; i < 3; ++i) dl->PrimWriteVtx(at(f[i]), uv, shade(f[i]));
+ dl->PrimWriteIdx(base);
+ dl->PrimWriteIdx(ImDrawIdx(base + 1));
+ dl->PrimWriteIdx(ImDrawIdx(base + 2));
}
+ const ImVec2 mouse = ImGui::GetIO().MousePos;
+ if (!ImGui::GetIO().WantCaptureMouse && glm::length(glm::vec2(mouse.x, mouse.y) - c) <= r)
+ dl->AddCircle(ImVec2(c.x, c.y), r, IM_COL32(255, 255, 255, 140), 0, 1.5f * uiScale_);
}
void App::drawBrushCursor() {
diff --git a/src/app/App.h b/src/app/App.h
index 34fbdfa2..3e28a1fd 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -1346,6 +1346,10 @@ private:
void drawAxisGizmo();
std::array<AxisGizmoEnd, 6> axisGizmoLayout() const; // the gizmo's ends on screen now (AxisGizmo.h)
bool axisGizmoMouseDown(float x, float y); // a click on an end: that side view (#43)
+ float axisGizmoUnit() const; // UI scale times Draw > Camera > Gizmo size
+ glm::vec2 viewFigureCentre() const; // Draw > Camera > View Figure: where it sits, how big
+ float viewFigureRadius() const;
+ void drawViewFigure();
// Insert on the model (#34): the primitive chosen in Append > Insert; a drag on the surface places it.
// "mesh" inserts your own mesh instead: insertMeshKey_ is "subtool" (a SubTool's name) or "file" (a path
// chosen in the file dialog), insertMeshValue_ the name or path (insert_mesh).
diff --git a/src/app/AxisGizmo.h b/src/app/AxisGizmo.h
index 4af079db..ca12cec5 100644
--- a/src/app/AxisGizmo.h
+++ b/src/app/AxisGizmo.h
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// The axis gizmo in the canvas corner (Draw > Camera > Axes, #31): where its six ends sit on screen for a view,
-// which end a click lands on, and the side view each end snaps to (#43, as in Blender). Pure arithmetic (no
-// ImGui), so it can be unit tested.
+// which end a click lands on, and the side view each end snaps to (#43, as in Blender); its size (Small / Medium /
+// Large) and the View Figure's snap to the nearest side. Pure arithmetic (no ImGui), so it can be unit tested.
#pragma once
#include <glm/glm.hpp>
@@ -57,4 +57,16 @@ inline AxisGizmoView axisGizmoView(int axis, bool negative) {
return views[(negative ? 3 : 0) + (axis < 0 || axis > 2 ? 0 : axis)];
}
+// Draw > Camera > Gizmo size: 0 Small, 1 Medium (the size before 0.10.8, the default), 2 Large. Multiplies the
+// gizmo's length, balls and click radius on top of the UI scale.
+inline float axisGizmoScale(int size) { return size <= 0 ? 0.65f : size == 1 ? 1.0f : 1.4f; }
+
+// The end facing the viewer most: the side view nearest the current one (a click on the View Figure snaps there).
+inline int axisGizmoFacing(const std::array<AxisGizmoEnd, 6>& ends) {
+ int best = 0;
+ for (int i = 1; i < 6; ++i)
+ if (ends[size_t(i)].depth > ends[size_t(best)].depth) best = i;
+ return best;
+}
+
} // namespace sf
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 7174c9cf..575cf187 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -90,6 +90,8 @@ Json toJson(const UiPrefs& p) {
j.set("cursorFollowsSurface", p.cursorFollowsSurface);
j.set("timelinePosition", std::string(p.timelineTop ? "top" : "bottom"));
j.set("showAxes", p.showAxes);
+ j.set("axisGizmoSize", std::string(p.axisGizmoSize == 0 ? "small" : p.axisGizmoSize == 2 ? "large" : "medium"));
+ j.set("showViewFigure", p.showViewFigure);
j.set("alphabeticalPalettes", p.alphabeticalPalettes);
lookToJson(p, j);
j.set("language", p.language);
@@ -145,6 +147,11 @@ void fromJson(const Json& j, UiPrefs& p) {
p.cursorFollowsSurface = j["cursorFollowsSurface"].asBool(p.cursorFollowsSurface);
if (j["timelinePosition"].isString()) p.timelineTop = j["timelinePosition"].asString() != "bottom";
p.showAxes = j["showAxes"].asBool(p.showAxes);
+ if (j["axisGizmoSize"].isString()) {
+ const std::string size = j["axisGizmoSize"].asString();
+ p.axisGizmoSize = size == "small" ? 0 : size == "large" ? 2 : 1;
+ }
+ p.showViewFigure = j["showViewFigure"].asBool(p.showViewFigure);
p.alphabeticalPalettes = j["alphabeticalPalettes"].asBool(p.alphabeticalPalettes);
// A ui.json from before 0.10.7 names neither: it was stored with the Classic look and the ZBrush-style layout,
// and keeps them (the new-look card offers the new default once, PanelSupport.cpp).
diff --git a/src/app/Config.h b/src/app/Config.h
index 72e0a278..b99af32e 100644
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@ -55,6 +55,8 @@ struct UiPrefs {
bool airStrokes = false; // start strokes off the model (#62): a left-drag on the background sculpts once it
// reaches the surface instead of turning the view (off: it turns the view, ZBrush)
bool showAxes = true; // Draw > Camera > Axes: the X / Y / Z gizmo in the canvas corner (#31)
+ int axisGizmoSize = 1; // Draw > Camera > Gizmo size: 0 Small, 1 Medium, 2 Large (axisGizmoScale)
+ bool showViewFigure = false; // Draw > Camera > View Figure: a small shaded head that turns with the view
bool cursorFollowsSurface = true; // the brush ring lies on the surface under the pointer, as in SculptGL (#25)
// Preferences > Interface > Timeline position (#63): the Sculpt Timeline strip along the top of the viewport
// (true, the default: clear of the brush shelf below it) or its bottom.
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index 2ab4aec6..fa3d7af8 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -237,6 +237,15 @@ void App::registerViewActions() {
add("view.top", "Top view", "Numpad 7", "Look down on the model (orthographic).", [this] { viewAxis(0.0f, -90.0f); });
add("view.bottom", "Bottom view", "Ctrl+Numpad 7", "Look up at the model from below (orthographic).",
[this] { viewAxis(0.0f, 90.0f); });
+ // Draw > Camera: the corner gizmo's size (Small / Medium / Large, saved in the preferences).
+ static constexpr const char* sizeIds[3] = {"view.gizmo_small", "view.gizmo_medium", "view.gizmo_large"};
+ static constexpr const char* sizeLabels[3] = {"Small", "Medium", "Large"};
+ for (int i = 0; i < 3; ++i)
+ add(sizeIds[i], sizeLabels[i], "",
+ "Gizmo size: how big the X / Y / Z axes and the View Figure are in the corner of the canvas. Grows with "
+ "the UI scale.",
+ [this, i] { uiPrefs_.axisGizmoSize = i; },
+ [this, i] { return uiPrefs_.axisGizmoSize == i; });
add("view.ortho", "Orthographic", "Numpad 5",
"Switch between a perspective and an orthographic view (no foreshortening: sizes don't shrink with depth).",
[this] {
diff --git a/src/app/Palettes.cpp b/src/app/Palettes.cpp
index 36025693..b5ef92b9 100644
--- a/src/app/Palettes.cpp
+++ b/src/app/Palettes.cpp
@@ -429,6 +429,14 @@ void App::drawPalette_Draw() {
}
ui::Checkbox("Axes##draw.axes", &uiPrefs_.showAxes);
ui::HelpText("Axes", nullptr, "Show the X / Y / Z directions in the corner of the canvas.", "Draw > Camera");
+ ImGui::SameLine();
+ ui::Checkbox("View Figure##draw.view_figure", &uiPrefs_.showViewFigure);
+ ui::HelpText("View Figure", nullptr,
+ "Show a small shaded head in the corner of the canvas that turns with the view. Click it to look "
+ "from the nearest side (front, back, left, right, top or bottom).",
+ "Draw > Camera");
+ hint(*this, "Gizmo size");
+ segmented(*this, {"view.gizmo_small", "view.gizmo_medium", "view.gizmo_large"});
}
// Tablet: the same Pressure > Strength / Size toggles as the top shelf (not checkboxes), and the pen state as
// a hint line.
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index fcef8be5..83eb0651 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -662,6 +662,9 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "timeline_top") return app_.uiPrefs_.timelineTop ? 1.0 : 0.0;
// The style's minimum window height in unscaled px (32): switching looks must not scale it again each time.
if (name == "style_window_min") return double(ImGui::GetStyle().WindowMinSize.y / std::max(app_.uiScale_, 0.01f));
+ // Draw > Camera > Gizmo size and View Figure: the axes' length in unscaled px (34 at Medium), the figure shown.
+ if (name == "axis_gizmo_length") return double(34.0f * app_.axisGizmoUnit() / std::max(app_.uiScale_, 0.01f));
+ if (name == "view_figure") return app_.uiPrefs_.showViewFigure ? 1.0 : 0.0;
if (name == "timeline_y" || name == "axis_gizmo_y") {
const auto c = app_.canvasRect();
if (name == "timeline_y")
@@ -977,6 +980,17 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
stroke([at](float) { return *at; }, 0.2f);
run([this] { SDL_SetModState(held_); });
wait(0.1f);
+ } else if (verb == "view_figure_click") {
+ // view_figure_click [DX DY]: click the View Figure (Draw > Camera), DX DY its radii from the centre
+ const float dx = num(1, 0.0f), dy = num(2, 0.0f);
+ auto at = std::make_shared<ImVec2>();
+ run([this, at, dx, dy] {
+ const glm::vec2 c = app_.viewFigureCentre() + glm::vec2(dx, dy) * app_.viewFigureRadius();
+ *at = ImVec2(c.x, c.y);
+ });
+ stroke([at](float) { return *at; }, 0.2f);
+ run([this] { SDL_SetModState(held_); });
+ wait(0.1f);
} else if (verb == "click_subtool") {
if (!need(1)) return false;
const std::string name = w[1];
diff --git a/tests/test_axis_gizmo.cpp b/tests/test_axis_gizmo.cpp
index 88150d2f..16d129bc 100644
--- a/tests/test_axis_gizmo.cpp
+++ b/tests/test_axis_gizmo.cpp
@@ -47,3 +47,36 @@ TEST(axis_gizmo_ends_snap_to_the_side_they_point_at) {
CHECK(ends[size_t(i)].depth > 0.99f);
}
}
+
+TEST(axis_gizmo_hit_works_at_every_size) {
+ // Draw > Camera > Gizmo size: the ends and the click radius scale together, so each end is still the one hit.
+ Camera c;
+ c.yaw = glm::radians(30.0f);
+ c.pitch = glm::radians(-20.0f);
+ CHECK(axisGizmoScale(0) < axisGizmoScale(1) && axisGizmoScale(1) == 1.0f && axisGizmoScale(1) < axisGizmoScale(2));
+ for (int size = 0; size < 3; ++size)
+ for (float uiScale : {1.0f, 2.0f}) {
+ const float unit = uiScale * axisGizmoScale(size);
+ const auto ends = axisGizmoEnds(glm::mat3(c.view()), glm::vec2(200.0f, 200.0f), 34.0f * unit);
+ for (int i = 0; i < 6; ++i) {
+ const glm::vec2 p = ends[size_t(i)].at + glm::vec2(4.0f, -3.0f) * unit;
+ const int hit = axisGizmoHit(ends, p.x, p.y, 9.0f * unit);
+ CHECK(hit >= 0 && ends[size_t(hit)].axis == ends[size_t(i)].axis &&
+ ends[size_t(hit)].negative == ends[size_t(i)].negative);
+ }
+ CHECK(axisGizmoHit(ends, 200.0f + 34.0f * unit * 2.0f, 200.0f, 9.0f * unit) == -1);
+ }
+}
+
+TEST(view_figure_snaps_to_the_nearest_side) {
+ // A view a little off the right side snaps to the right; one mostly from above snaps to the top.
+ Camera c;
+ c.yaw = glm::radians(70.0f);
+ c.pitch = glm::radians(-15.0f);
+ int facing = axisGizmoFacing(axisGizmoEnds(glm::mat3(c.view()), glm::vec2(0.0f), 30.0f));
+ CHECK(std::strcmp(axisGizmoView(facing % 3, facing >= 3).action, "view.right") == 0);
+ c.yaw = glm::radians(20.0f);
+ c.pitch = glm::radians(-60.0f);
+ facing = axisGizmoFacing(axisGizmoEnds(glm::mat3(c.view()), glm::vec2(0.0f), 30.0f));
+ CHECK(std::strcmp(axisGizmoView(facing % 3, facing >= 3).action, "view.top") == 0);
+}
diff --git a/tests/ui/view_gizmo_size.sfui b/tests/ui/view_gizmo_size.sfui
new file mode 100644
index 00000000..648bab08
--- /dev/null
+++ b/tests/ui/view_gizmo_size.sfui
@@ -0,0 +1,56 @@
+# Draw > Camera (Discord request): Gizmo size Small / Medium / Large for the corner axes, and the View Figure, a
+# small shaded head that turns with the view; a click on it snaps to the nearest side view.
+run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run new_sphere subdivisions=4
+key f
+expect_value axis_gizmo_length == 34
+expect_value view_figure == 0
+
+# Gizmo size: Small and Large; a click on an end still snaps at either size.
+click "Draw##palette.draw"
+expect "View Figure##draw.view_figure"
+click "Small##view.gizmo_small"
+key escape
+expect_value axis_gizmo_length < 30
+shot small
+axis_click +x
+expect_value camera_yaw > 89.9
+expect_value camera_yaw < 90.1
+click "Draw##palette.draw"
+click "Large##view.gizmo_large"
+key escape
+expect_value axis_gizmo_length > 40
+shot large
+axis_click +z
+expect_value camera_yaw == 0
+expect_value camera_pitch == 0
+
+# View Figure on: turn the view a little off the right side, then a click on the figure looks from the right.
+click "Draw##palette.draw"
+click "Medium##view.gizmo_medium"
+click "View Figure##draw.view_figure"
+expect_value view_figure == 1
+key escape
+key numpad6
+key numpad6
+key numpad6
+key numpad6
+key numpad6
+expect_value camera_yaw > 70
+expect_value camera_yaw < 80
+shot view_figure
+view_figure_click
+expect_value camera_yaw > 89.9
+expect_value camera_yaw < 90.1
+expect_value camera_ortho == 1
+expect_value camera_aligned == 1
+shot view_figure_right
+
+# Off again: the same spot no longer snaps (and the axes still do).
+click "Draw##palette.draw"
+click "View Figure##draw.view_figure"
+expect_value view_figure == 0
+key escape
+key numpad6
+view_figure_click
+expect_value camera_yaw > 100
diff --git a/tests/ui/whats_new.sfui b/tests/ui/whats_new.sfui
index 6b70eb9d..1ea07358 100644
--- a/tests/ui/whats_new.sfui
+++ b/tests/ui/whats_new.sfui
@@ -5,8 +5,9 @@ click "Help##palette.help"
click "What's New##help.whats_new"
expect_value guide_open == 1
expect_guide whats-new.md
+expect_text "Version 0.10.8"
+expect_text "View Figure"
expect_text "Version 0.10.7"
-expect_text "A new look"
expect_text "Version 0.10.6"
expect_text "Version 0.10.5"
expect_text "Version 0.10.4"