ScrollGestureDirectionForOrthoViewports
ScrollGestureDirectionForOrthoViewports
#Overview
name: ScrollGestureDirectionForOrthoViewports
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ScrollGestureDirectionForOrthoViewports is to control the direction of scroll gestures in orthographic viewports within the Unreal Engine editor. This setting variable is primarily used for handling user input and interaction in various editor interfaces.
This setting variable is relied upon by several Unreal Engine subsystems and modules, including:
- DMX Pixel Mapping Editor
- Graph Editor
- UMG Editor
- Level Editor Viewport
The value of this variable is set in the LevelEditorViewportSettings class, which is part of the UnrealEd module. It is defined as an UPROPERTY, which means it can be edited in the editor’s project settings.
This variable interacts with the EScrollGestureDirection enum, which likely defines the possible values for the scroll direction (such as Natural, Inverted, or UseSystemSetting).
Developers should be aware that this variable affects the behavior of scroll gestures across multiple editor interfaces. Changing this setting will impact user interaction in orthographic viewports throughout the engine.
Best practices when using this variable include:
- Consistently applying the setting across all relevant interfaces to maintain a uniform user experience.
- Considering user preferences and system settings when deciding on the default value.
- Providing clear documentation or UI labels to explain the effect of this setting to end-users.
- Testing the scroll behavior thoroughly in all affected viewports after making changes to this setting.
When implementing new editor interfaces that involve orthographic viewports and scroll gestures, developers should reference this setting to ensure consistent behavior with the rest of the engine.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:349, section: [/Script/UnrealEd.LevelEditorViewportSettings]
- INI Section:
/Script/UnrealEd.LevelEditorViewportSettings
- Raw value:
UseSystemSetting
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXPixelMapping/Source/DMXPixelMappingEditor/Private/Widgets/SDMXPixelMappingSurface.cpp:366
Scope (from outer to inner):
file
function FReply SDMXPixelMappingSurface::OnTouchGesture
Source code excerpt:
else if (GestureType == EGestureEvent::Scroll)
{
const EScrollGestureDirection DirectionSetting = GetDefault<ULevelEditorViewportSettings>()->ScrollGestureDirectionForOrthoViewports;
const bool bUseDirectionInvertdFromDevice = DirectionSetting == EScrollGestureDirection::Natural || (DirectionSetting == EScrollGestureDirection::UseSystemSetting && GestureEvent.IsDirectionInvertedFromDevice());
bIsPanning = true;
ViewOffset -= (bUseDirectionInvertdFromDevice == GestureEvent.IsDirectionInvertedFromDevice() ? GestureDelta : -GestureDelta) / GetZoomAmount();
return FReply::Handled();
}
#Loc: <Workspace>/Engine/Source/Editor/GraphEditor/Private/SNodePanel.cpp:1147
Scope (from outer to inner):
file
function FReply SNodePanel::OnTouchGesture
Source code excerpt:
else if (GestureType == EGestureEvent::Scroll)
{
const EScrollGestureDirection DirectionSetting = GetDefault<ULevelEditorViewportSettings>()->ScrollGestureDirectionForOrthoViewports;
const bool bUseDirectionInvertedFromDevice = DirectionSetting == EScrollGestureDirection::Natural || (DirectionSetting == EScrollGestureDirection::UseSystemSetting && GestureEvent.IsDirectionInvertedFromDevice());
this->bIsPanning = true;
ViewOffset -= (bUseDirectionInvertedFromDevice == GestureEvent.IsDirectionInvertedFromDevice() ? GestureDelta : -GestureDelta) / GetZoomAmount();
// Stop the zoom-to-fit in favor of user control
#Loc: <Workspace>/Engine/Source/Editor/UMGEditor/Private/Designer/SDesignSurface.cpp:330
Scope (from outer to inner):
file
function FReply SDesignSurface::OnTouchGesture
Source code excerpt:
else if ( GestureType == EGestureEvent::Scroll )
{
const EScrollGestureDirection DirectionSetting = GetDefault<ULevelEditorViewportSettings>()->ScrollGestureDirectionForOrthoViewports;
const bool bUseDirectionInvertedFromDevice = DirectionSetting == EScrollGestureDirection::Natural || (DirectionSetting == EScrollGestureDirection::UseSystemSetting && GestureEvent.IsDirectionInvertedFromDevice());
this->bIsPanning = true;
ViewOffset -= (bUseDirectionInvertedFromDevice == GestureEvent.IsDirectionInvertedFromDevice() ? GestureDelta : -GestureDelta) / GetZoomAmount();
return FReply::Handled();
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorViewportSettings.h:379
Scope (from outer to inner):
file
class class ULevelEditorViewportSettings : public UObject
Source code excerpt:
/** Direction of the scroll gesture for orthographic viewports */
UPROPERTY(EditAnywhere, config, Category=Controls, meta=(DisplayName="Scroll gesture direction for orthographic viewports"))
EScrollGestureDirection ScrollGestureDirectionForOrthoViewports;
/** Enables joystick-based camera movement in 3D level editing viewports */
UPROPERTY(EditAnywhere, config, Category=Controls, meta=(DisplayName="Level Editor Joystick Controls" ) )
bool bLevelEditorJoystickControls;
/** If enabled, scale the perspective camera speed based on the distance between the camera and its look-at position */
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorViewportClient.cpp:4764
Scope (from outer to inner):
file
function bool FEditorViewportClient::InputGesture
Source code excerpt:
const float UnitsPerPixel = GetOrthoUnitsPerPixel(InViewport);
const EScrollGestureDirection DirectionSetting = GetDefault<ULevelEditorViewportSettings>()->ScrollGestureDirectionForOrthoViewports;
const bool bUseDirectionInvertedFromDevice = DirectionSetting == EScrollGestureDirection::Natural || (DirectionSetting == EScrollGestureDirection::UseSystemSetting && bIsDirectionInvertedFromDevice);
// GestureDelta is in window pixel coords. Adjust for ortho units.
const FVector2D AdjustedGestureDelta = (bUseDirectionInvertedFromDevice == bIsDirectionInvertedFromDevice ? GestureDelta : -GestureDelta) * UnitsPerPixel;
switch (LevelViewportType)