class

MCurveEditor

Module
Miri
Header
#include "Miri/Widgets/MCurveEditor.h"
Namespace
Miri

Properties

TypeNameDescription
MiriDelegate<void(const CMiriCurve&)>OnCurveChanged
MiriDelegate<void(int32_t)>OnKeySelectionChanged

Public functions

ReturnsNameDescription
MIRI_WIDGET_ARGS
MiriVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
CReplyOnMouseWheel
CReplyOnKeyDown
boolIsFocusable
EFocusVisualGetFocusVisualThe canvas shows focus as its BorderNormal frame and the focused key carries the ring; a second ring round the whole plot would be noise.
voidPaintKeyThe design's curve-key: a 9 px square turned 45 degrees, filled by state (TextBright, AccentHover hovered, AccentColor pressed or selected, TextDisabled, Error), with the FocusRing around it when focused.
voidPaintTangentA selected key's tangent: the 1 px line and the 6 px round handle.
voidPaintCanvasThe canvas: TimelineBg, PanelBorder (BorderNormal while focused).
boolTangentModeForDigitInterpolation by the curve-key shortcut: 1 auto, 2 user, 3 linear, 4 constant.
boolSetKeyInterpolationSets a key's interpolation the way the 1-4 shortcuts do.
voidApplyTangentDragWhat a handle drag does to the key: the dragged side takes the slope, the other side follows unless the tangents are broken or Alt is held (which breaks them).
voidSetCurve
const CMiriCurve&GetCurve
int32_tGetSelectedKey
voidSelectKey
boolUpdateKey
voidSetViewRange
voidFrameViewToKeys
voidSetPopupTitle
voidSetPopupEnabled
voidOpenPresetPopup
EMiriCursorTypeOnCursorQuery
const char*GetTypeName

Function details

MIRI_WIDGET_ARGS

C++
MIRI_WIDGET_ARGS(MCurveEditor) MIRI_ARG(float, MinTime) MIRI_ARG(float, MaxTime) MIRI_ARG(float, MinValue) MIRI_ARG(float, MaxValue) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)

ComputeDesiredSize

C++
MiriVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& renderer, int32_t layerId) const override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseWheel

C++
CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event) override

OnKeyDown

C++
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) override

IsFocusable

C++
bool IsFocusable() const override

GetFocusVisual

C++
EFocusVisual GetFocusVisual() const override

The canvas shows focus as its BorderNormal frame and the focused key carries the ring; a second ring round the whole plot would be noise.

PaintKey

C++
static void PaintKey(CMiriRenderer& renderer, const MiriVec2& center, Mowo::EMiriSpecState state, float opacity = 1.0f)

The design's curve-key: a 9 px square turned 45 degrees, filled by state (TextBright, AccentHover hovered, AccentColor pressed or selected, TextDisabled, Error), with the FocusRing around it when focused. Every curve canvas paints its keys with this.

PaintTangent

C++
static void PaintTangent(CMiriRenderer& renderer, const MiriVec2& key, const MiriVec2& handle, float opacity = 1.0f)

A selected key's tangent: the 1 px line and the 6 px round handle.

PaintCanvas

C++
static void PaintCanvas(CMiriRenderer& renderer, const MiriRect& rect, bool focused, float opacity = 1.0f)

The canvas: TimelineBg, PanelBorder (BorderNormal while focused).

TangentModeForDigit

C++
static bool TangentModeForDigit(int32_t digit, ECurveTangentMode& outMode)

Interpolation by the curve-key shortcut: 1 auto, 2 user, 3 linear, 4 constant. Returns false for any other digit.

SetKeyInterpolation

C++
bool SetKeyInterpolation(int32_t index, ECurveTangentMode mode)

Sets a key's interpolation the way the 1-4 shortcuts do.

ApplyTangentDrag

C++
static void ApplyTangentDrag(CMiriCurveKey& key, bool arrive, float slope, bool breakTangents)

What a handle drag does to the key: the dragged side takes the slope, the other side follows unless the tangents are broken or Alt is held (which breaks them).

SetCurve

C++
void SetCurve(const CMiriCurve& curve)

GetCurve

C++
const CMiriCurve& GetCurve() const

GetSelectedKey

C++
int32_t GetSelectedKey() const

SelectKey

C++
void SelectKey(int32_t index)

UpdateKey

C++
bool UpdateKey(int32_t index, const CMiriCurveKey& key)

SetViewRange

C++
void SetViewRange(float minTime, float maxTime, float minValue, float maxValue)

FrameViewToKeys

C++
void FrameViewToKeys(float padRatio = 0.15f)

SetPopupTitle

C++
void SetPopupTitle(const std::string& title)

SetPopupEnabled

C++
void SetPopupEnabled(bool enabled)

OpenPresetPopup

C++
void OpenPresetPopup()

OnCursorQuery

C++
EMiriCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const override

GetTypeName

C++
const char* GetTypeName() const override
Generated from Miri/Widgets/MCurveEditor.h via miri.json · Dec 5, 2026Version 1.1.0