Files
anm2ed/src/ui/animation_preview.h
T
shweet f35f9cb4b8 Build cleanly under clang, and name the remaining booleans with is
Exported XML templates lose the static clang rejects. Unused this captures,
a dead null check, an undefined declaration, an unused constant and stray
semicolons go, and single statements lose their braces.
2026-11-22 19:35:33 -05:00

41 lines
1.0 KiB
C++

#pragma once
#include <tuple>
#include <vector>
#include "ui/canvas_view.h"
#include "manager.h"
#include "model/draw.h"
#include "render.h"
#include "resources.h"
#include "settings.h"
class AnimationPreview : public CanvasView
{
bool isPlaybackPlayingBefore = false;
int soundFrame = -1;
bool isMoveDragging = false;
Vec2 moveOffset{};
Vec2 nullRectScaleAnchor{};
Recorder recorder = {};
Vec2 recordSize{};
Vec2 recordPan{};
float recordZoom = 0;
// Where each item's pivot is at every frame of the animation, kept until the document or view changes.
struct PivotPath
{
Draw item = {};
std::vector<Vec2> points{};
};
std::vector<PivotPath> pivotPaths;
std::tuple<std::uint64_t, std::uint64_t, int, bool> pivotPathsKey;
void recording_start(Manager&, Settings&, Document&, const Animation*);
void recording_stop(Manager&, Document&);
public:
void tick(Manager&, Settings&, float);
void update(Manager&, Settings&, Resources&);
};