mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Remove relative units from bounding box
When adding units to the external inset bounding box I overlooked that InsetGraphics supports only bb, cm, mm and in. Therefore I added too many units for the external insets. We are not as strict as the graphics inset and allow all absolute units, but no relative ones.
This commit is contained in:
parent
eaf70913ac
commit
bf515425e1
@ -220,6 +220,18 @@ GuiExternal::GuiExternal(GuiView & lv)
|
|||||||
|
|
||||||
// add scale item
|
// add scale item
|
||||||
widthUnitCO->insertItem(0, qt_("Scale%"), "scale");
|
widthUnitCO->insertItem(0, qt_("Scale%"), "scale");
|
||||||
|
|
||||||
|
// remove all units from bb that depend on font or other dimensions
|
||||||
|
// we cannot use these, since we need to compare against absolute
|
||||||
|
// values from the image file.
|
||||||
|
xlUnitCO->noPercents();
|
||||||
|
xlUnitCO->removeFontDependent();
|
||||||
|
xrUnitCO->noPercents();
|
||||||
|
xrUnitCO->removeFontDependent();
|
||||||
|
ytUnitCO->noPercents();
|
||||||
|
ytUnitCO->removeFontDependent();
|
||||||
|
ybUnitCO->noPercents();
|
||||||
|
ybUnitCO->removeFontDependent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,6 +98,14 @@ void LengthCombo::noPercents()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LengthCombo::removeFontDependent()
|
||||||
|
{
|
||||||
|
removeUnit(Length::EM);
|
||||||
|
removeUnit(Length::EX);
|
||||||
|
removeUnit(Length::MU);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void LengthCombo::removeUnit(lyx::Length::UNIT unit)
|
void LengthCombo::removeUnit(lyx::Length::UNIT unit)
|
||||||
{
|
{
|
||||||
QString const val = lyx::toqstr(lyx::stringFromUnit(unit));
|
QString const val = lyx::toqstr(lyx::stringFromUnit(unit));
|
||||||
|
@ -41,6 +41,8 @@ public:
|
|||||||
virtual void setEnabled(bool b);
|
virtual void setEnabled(bool b);
|
||||||
/// use the %-items?
|
/// use the %-items?
|
||||||
void noPercents();
|
void noPercents();
|
||||||
|
/// Remove EM, EX and MU units
|
||||||
|
void removeFontDependent();
|
||||||
/// remove a unit from the combo
|
/// remove a unit from the combo
|
||||||
void removeUnit(lyx::Length::UNIT unit);
|
void removeUnit(lyx::Length::UNIT unit);
|
||||||
/// add a unit to the combo
|
/// add a unit to the combo
|
||||||
|
Loading…
Reference in New Issue
Block a user