Added a flip zoom tool direction option
This commit is contained in:
parent
7333ddc9d8
commit
1945b04e69
3 changed files with 6 additions and 1 deletions
|
|
@ -123,7 +123,7 @@ void DrawCamera::update_main(World& w) {
|
||||||
}
|
}
|
||||||
isAccurateZooming = newIsAccurateZooming;
|
isAccurateZooming = newIsAccurateZooming;
|
||||||
if(isAccurateZooming) {
|
if(isAccurateZooming) {
|
||||||
WorldScalar zoomFactor(std::pow(1.0 + w.main.toolbar.dragZoomSpeed, -w.main.input.mouse.move.y()));
|
WorldScalar zoomFactor(std::pow(1.0 + w.main.toolbar.dragZoomSpeed, w.main.toolbar.flipZoomToolDirection ? w.main.input.mouse.move.y() : -w.main.input.mouse.move.y()));
|
||||||
c.scale(zoomFactor);
|
c.scale(zoomFactor);
|
||||||
WorldVec mVec = startZoomCameraPos - startZoomMousePos;
|
WorldVec mVec = startZoomCameraPos - startZoomMousePos;
|
||||||
WorldScalar mX = c.inverseScale / startZoomVal;
|
WorldScalar mX = c.inverseScale / startZoomVal;
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,7 @@ nlohmann::json Toolbar::get_config_json() {
|
||||||
toRet["velocityAffectsBrushWidth"] = velocityAffectsBrushWidth;
|
toRet["velocityAffectsBrushWidth"] = velocityAffectsBrushWidth;
|
||||||
toRet["jumpTransitionEasing"] = jumpTransitionEasing;
|
toRet["jumpTransitionEasing"] = jumpTransitionEasing;
|
||||||
toRet["defaultCanvasBackgroundColor"] = main.defaultCanvasBackgroundColor;
|
toRet["defaultCanvasBackgroundColor"] = main.defaultCanvasBackgroundColor;
|
||||||
|
toRet["flipZoomToolDirection"] = flipZoomToolDirection;
|
||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
toRet["checkForUpdates"] = updateCheckerData.checkForUpdates;
|
toRet["checkForUpdates"] = updateCheckerData.checkForUpdates;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -278,6 +279,7 @@ void Toolbar::set_config_json(const nlohmann::json& j) {
|
||||||
j.at("velocityAffectsBrushWidth").get_to(velocityAffectsBrushWidth);
|
j.at("velocityAffectsBrushWidth").get_to(velocityAffectsBrushWidth);
|
||||||
j.at("jumpTransitionEasing").get_to(jumpTransitionEasing);
|
j.at("jumpTransitionEasing").get_to(jumpTransitionEasing);
|
||||||
j.at("defaultCanvasBackgroundColor").get_to(main.defaultCanvasBackgroundColor);
|
j.at("defaultCanvasBackgroundColor").get_to(main.defaultCanvasBackgroundColor);
|
||||||
|
j.at("flipZoomToolDirection").get_to(flipZoomToolDirection);
|
||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
j.at("checkForUpdates").get_to(updateCheckerData.checkForUpdates);
|
j.at("checkForUpdates").get_to(updateCheckerData.checkForUpdates);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1381,6 +1383,7 @@ void Toolbar::options_menu() {
|
||||||
#endif
|
#endif
|
||||||
gui.slider_scalar_field("drag zoom slider", "Drag zoom speed", &dragZoomSpeed, 0.0, 1.0, 3);
|
gui.slider_scalar_field("drag zoom slider", "Drag zoom speed", &dragZoomSpeed, 0.0, 1.0, 3);
|
||||||
gui.slider_scalar_field("scroll zoom slider", "Scroll zoom speed", &scrollZoomSpeed, 0.0, 1.0, 3);
|
gui.slider_scalar_field("scroll zoom slider", "Scroll zoom speed", &scrollZoomSpeed, 0.0, 1.0, 3);
|
||||||
|
gui.checkbox_field("flip zoom tool direction", "Flip zoom tool direction", &flipZoomToolDirection);
|
||||||
gui.input_scalar_field("jump transition time", "Jump transition time", &jumpTransitionTime, 0.01f, 1000.0f, 2);
|
gui.input_scalar_field("jump transition time", "Jump transition time", &jumpTransitionTime, 0.01f, 1000.0f, 2);
|
||||||
gui.checkbox_field("changebrushwidthwithspeed", "Change brush size with mouse speed", &velocityAffectsBrushWidth);
|
gui.checkbox_field("changebrushwidthwithspeed", "Change brush size with mouse speed", &velocityAffectsBrushWidth);
|
||||||
gui.pop_id();
|
gui.pop_id();
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@ class Toolbar {
|
||||||
Vector4f* colorRight = nullptr;
|
Vector4f* colorRight = nullptr;
|
||||||
std::optional<Vector2f> paintPopupLocation;
|
std::optional<Vector2f> paintPopupLocation;
|
||||||
|
|
||||||
|
bool flipZoomToolDirection = false;
|
||||||
|
|
||||||
float final_gui_scale();
|
float final_gui_scale();
|
||||||
private:
|
private:
|
||||||
void calculate_final_gui_scale();
|
void calculate_final_gui_scale();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue