Fix StyleBoxLine's incorrect style margin values
This commit is contained in:
parent
9335f4de70
commit
ddf05a7c3c
1 changed files with 11 additions and 2 deletions
|
@ -937,8 +937,17 @@ void StyleBoxLine::_bind_methods() {
|
||||||
}
|
}
|
||||||
|
|
||||||
float StyleBoxLine::get_style_margin(Side p_side) const {
|
float StyleBoxLine::get_style_margin(Side p_side) const {
|
||||||
ERR_FAIL_INDEX_V((int)p_side, 4, thickness);
|
ERR_FAIL_INDEX_V((int)p_side, 4, 0);
|
||||||
return thickness;
|
|
||||||
|
if (vertical) {
|
||||||
|
if (p_side == SIDE_LEFT || p_side == SIDE_RIGHT) {
|
||||||
|
return thickness / 2.0;
|
||||||
|
}
|
||||||
|
} else if (p_side == SIDE_TOP || p_side == SIDE_BOTTOM) {
|
||||||
|
return thickness / 2.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Size2 StyleBoxLine::get_center_size() const {
|
Size2 StyleBoxLine::get_center_size() const {
|
||||||
|
|
Loading…
Reference in a new issue