mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Visual Console Client: minor fix
Former-commit-id: 7e20bc7972f98e2cfe1a991d82cbf2dbc12c21de
This commit is contained in:
parent
af26c7cdfc
commit
c0f8c289e6
@ -53,7 +53,10 @@ export default class Box extends Item<BoxProps> {
|
|||||||
// Border.
|
// Border.
|
||||||
if (this.props.borderWidth > 0) {
|
if (this.props.borderWidth > 0) {
|
||||||
box.style.borderStyle = "solid";
|
box.style.borderStyle = "solid";
|
||||||
box.style.borderWidth = `${this.props.borderWidth}px`;
|
// Control the max width to prevent this item to expand beyond its parent.
|
||||||
|
const maxBorderWidth = Math.min(this.props.width, this.props.height) / 2;
|
||||||
|
const borderWidth = Math.min(this.props.borderWidth, maxBorderWidth);
|
||||||
|
box.style.borderWidth = `${borderWidth}px`;
|
||||||
|
|
||||||
if (this.props.borderColor) {
|
if (this.props.borderColor) {
|
||||||
box.style.borderColor = this.props.borderColor;
|
box.style.borderColor = this.props.borderColor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user