New upstream version 21.0.2+dfsg1
This commit is contained in:
parent
1f1bbb3518
commit
baafb6325b
706 changed files with 49633 additions and 5044 deletions
|
|
@ -14,6 +14,8 @@ class QMouseEvent;
|
|||
#define ITEM_TOP (1<<2)
|
||||
#define ITEM_BOTTOM (1<<3)
|
||||
|
||||
#define ZOOM_SENSITIVITY 1.125f
|
||||
|
||||
enum class ItemHandle : uint32_t {
|
||||
None = 0,
|
||||
TopLeft = ITEM_TOP | ITEM_LEFT,
|
||||
|
|
@ -26,12 +28,6 @@ enum class ItemHandle : uint32_t {
|
|||
BottomRight = ITEM_BOTTOM | ITEM_RIGHT
|
||||
};
|
||||
|
||||
enum class ScalingMode : uint32_t {
|
||||
Window = 0,
|
||||
Canvas = 1,
|
||||
Output = 2
|
||||
};
|
||||
|
||||
class OBSBasicPreview : public OBSQTDisplay {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
@ -41,7 +37,6 @@ private:
|
|||
vec2 cropSize;
|
||||
OBSSceneItem stretchItem;
|
||||
ItemHandle stretchHandle = ItemHandle::None;
|
||||
ScalingMode scale = ScalingMode::Window;
|
||||
vec2 stretchItemSize;
|
||||
matrix4 screenToItem;
|
||||
matrix4 itemToScreen;
|
||||
|
|
@ -56,6 +51,9 @@ private:
|
|||
bool cropping = false;
|
||||
bool locked = false;
|
||||
bool scrollMode = false;
|
||||
bool fixedScaling = false;
|
||||
int32_t scalingLevel = 0;
|
||||
float scalingAmount = 1.0f;
|
||||
|
||||
static vec2 GetMouseEventPos(QMouseEvent *event);
|
||||
static bool DrawSelectedItem(obs_scene_t *scene, obs_sceneitem_t *item,
|
||||
|
|
@ -88,22 +86,30 @@ public:
|
|||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
virtual void keyReleaseEvent(QKeyEvent *event) override;
|
||||
|
||||
virtual void wheelEvent(QWheelEvent *event) override;
|
||||
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||
|
||||
void DrawSceneEditing();
|
||||
void ResetScrollingOffset();
|
||||
|
||||
inline void SetLocked(bool newLockedVal) {locked = newLockedVal;}
|
||||
inline void ToggleLocked() {locked = !locked;}
|
||||
inline bool Locked() const {return locked;}
|
||||
|
||||
inline void SetScaling(ScalingMode newScaledVal) {scale = newScaledVal;}
|
||||
inline ScalingMode GetScalingMode() const {return scale;}
|
||||
inline void SetFixedScaling(bool newFixedScalingVal) { fixedScaling = newFixedScalingVal; }
|
||||
inline bool IsFixedScaling() const { return fixedScaling; }
|
||||
|
||||
inline float ScrollX() const {return scrollingOffset.x;}
|
||||
inline float ScrollY() const {return scrollingOffset.y;}
|
||||
void SetScalingLevel(int32_t newScalingLevelVal);
|
||||
void SetScalingAmount(float newScalingAmountVal);
|
||||
inline int32_t GetScalingLevel() const { return scalingLevel; }
|
||||
inline float GetScalingAmount() const { return scalingAmount; }
|
||||
|
||||
void ResetScrollingOffset();
|
||||
inline void SetScrollingOffset(float x, float y) {vec2_set(&scrollingOffset, x, y);}
|
||||
inline float GetScrollX() const {return scrollingOffset.x;}
|
||||
inline float GetScrollY() const {return scrollingOffset.y;}
|
||||
|
||||
/* use libobs allocator for alignment because the matrices itemToScreen
|
||||
* and screenToItem may contain SSE data, which will cause SSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue