MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / relative_width_gui

Method relative_width_gui

src/DrawingProgram/ToolConfiguration.cpp:101–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void ToolConfiguration::relative_width_gui(DrawingProgram& drawP, const char* label) {
102 auto& gui = drawP.world.main.g.gui;
103 auto& lockedCameraScale = drawP.controls.lockedCameraScale;
104 GUIStuff::ElementHelpers::slider_scalar_field(gui, "relstrokewidth", label, &get_stroke_size_relative_width_ref(drawP.drawTool->get_type()), 3.0f, 40.0f);
105 GUIStuff::ElementHelpers::text_button(gui, "lock brush size", lockedCameraScale.has_value() ? "Unlock Size" : "Lock Size to Zoom", {
106 .wide = true,
107 .onClick = [&] {
108 if(lockedCameraScale.has_value())
109 lockedCameraScale = std::nullopt;
110 else
111 lockedCameraScale = drawP.world.drawData.cam.c.inverseScale;
112 }
113 });
114}

Callers 10

gui_toolboxMethod · 0.80
gui_phone_toolboxMethod · 0.80
gui_toolboxMethod · 0.80
gui_phone_toolboxMethod · 0.80
gui_toolboxMethod · 0.80
gui_phone_toolboxMethod · 0.80
gui_toolboxMethod · 0.80
gui_phone_toolboxMethod · 0.80
gui_toolboxMethod · 0.80
gui_phone_toolboxMethod · 0.80

Calls 3

slider_scalar_fieldFunction · 0.85
text_buttonFunction · 0.85
get_typeMethod · 0.45

Tested by

no test coverage detected