提交 933f5787 编写于 作者: J jp9000

UI: Change transform value 'scale' to 'size'

There's no reason to represent this value in terms of scale.  Scale is a
useless value for users to use.  What are they going to enter, 0.5?
2.0?  0.25?

Even if it can be subject to change by the source itself, and even if
it's still converted to scale internally, having it display the base
source size value is much more ideal for the user.
上级 bd4223a2
......@@ -73,7 +73,7 @@ Basic.PropertiesWindow.AutoSelectFormat="%1 (unsupported; autoselect: %2)"
Basic.TransformWindow="Scene Item Transform"
Basic.TransformWindow.Position="Position"
Basic.TransformWindow.Rotation="Rotation"
Basic.TransformWindow.Scale="Scale"
Basic.TransformWindow.Size="Size"
Basic.TransformWindow.Alignment="Positional Alignment"
Basic.TransformWindow.BoundsType="Bounding Box Type"
Basic.TransformWindow.BoundsAlignment="Alignment in Bounding Box"
......
......@@ -76,11 +76,14 @@
<height>0</height>
</size>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>-9001.000000000000000</double>
<double>-90001.000000000000000</double>
</property>
<property name="maximum">
<double>9001.000000000000000</double>
<double>90001.000000000000000</double>
</property>
</widget>
</item>
......@@ -92,11 +95,14 @@
<height>0</height>
</size>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>-9001.000000000000000</double>
<double>-90001.000000000000000</double>
</property>
<property name="maximum">
<double>9001.000000000000000</double>
<double>90001.000000000000000</double>
</property>
</widget>
</item>
......@@ -138,7 +144,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Basic.TransformWindow.Scale</string>
<string>Basic.TransformWindow.Size</string>
</property>
</widget>
</item>
......@@ -164,40 +170,46 @@
<number>0</number>
</property>
<item>
<widget class="QDoubleSpinBox" name="scaleX">
<widget class="QDoubleSpinBox" name="sizeX">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>-9001.000000000000000</double>
<double>-90001.000000000000000</double>
</property>
<property name="maximum">
<double>9001.000000000000000</double>
<double>90001.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="scaleY">
<widget class="QDoubleSpinBox" name="sizeY">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>-9001.000000000000000</double>
<double>-90001.000000000000000</double>
</property>
<property name="maximum">
<double>9001.000000000000000</double>
<double>90001.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
<double>1.000000000000000</double>
</property>
</widget>
</item>
......@@ -368,11 +380,14 @@
<height>0</height>
</size>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>9001.000000000000000</double>
<double>90001.000000000000000</double>
</property>
</widget>
</item>
......@@ -387,11 +402,14 @@
<height>0</height>
</size>
</property>
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>9001.000000000000000</double>
<double>90001.000000000000000</double>
</property>
</widget>
</item>
......
......@@ -44,8 +44,8 @@ OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
HookWidget(ui->positionX, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->positionY, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->rotation, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->scaleX, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->scaleY, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->sizeX, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->sizeY, DSCROLL_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->align, COMBO_CHANGED, SLOT(OnControlChanged()));
HookWidget(ui->boundsType, COMBO_CHANGED, SLOT(OnBoundsType(int)));
HookWidget(ui->boundsAlign, COMBO_CHANGED, SLOT(OnControlChanged()));
......@@ -185,6 +185,10 @@ void OBSBasicTransform::RefreshControls()
obs_sceneitem_info osi;
obs_sceneitem_get_info(item, &osi);
obs_source_t source = obs_sceneitem_getsource(item);
float width = float(obs_source_getwidth(source));
float height = float(obs_source_getheight(source));
int alignIndex = AlignToList(osi.alignment);
int boundsAlignIndex = AlignToList(osi.bounds_alignment);
......@@ -192,8 +196,8 @@ void OBSBasicTransform::RefreshControls()
ui->positionX->setValue(osi.pos.x);
ui->positionY->setValue(osi.pos.y);
ui->rotation->setValue(osi.rot);
ui->scaleX->setValue(osi.scale.x);
ui->scaleY->setValue(osi.scale.y);
ui->sizeX->setValue(osi.scale.x * width);
ui->sizeY->setValue(osi.scale.y * height);
ui->align->setCurrentIndex(alignIndex);
ui->boundsType->setCurrentIndex(int(osi.bounds_type));
......@@ -235,12 +239,16 @@ void OBSBasicTransform::OnControlChanged()
if (ignoreItemChange)
return;
obs_source_t source = obs_sceneitem_getsource(item);
double width = double(obs_source_getwidth(source));
double height = double(obs_source_getheight(source));
obs_sceneitem_info osi;
osi.pos.x = float(ui->positionX->value());
osi.pos.y = float(ui->positionY->value());
osi.rot = float(ui->rotation->value());
osi.scale.x = float(ui->scaleX->value());
osi.scale.y = float(ui->scaleY->value());
osi.scale.x = float(ui->sizeX->value() / width);
osi.scale.y = float(ui->sizeY->value() / height);
osi.alignment = listToAlign[ui->align->currentIndex()];
osi.bounds_type = (obs_bounds_type)ui->boundsType->currentIndex();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册