diff --git a/src/ui/widgets/LED/led.module.css b/src/ui/widgets/LED/led.module.css index 57c605d4..c8744aad 100644 --- a/src/ui/widgets/LED/led.module.css +++ b/src/ui/widgets/LED/led.module.css @@ -1,6 +1,6 @@ .Led { - width: 16px; - height: 16px; + width: 11px; + height: 11px; border-radius: 50%; background-color: #00ee00; } diff --git a/src/ui/widgets/LED/led.test.tsx b/src/ui/widgets/LED/led.test.tsx index 7c9d84e2..056fba90 100644 --- a/src/ui/widgets/LED/led.test.tsx +++ b/src/ui/widgets/LED/led.test.tsx @@ -71,7 +71,10 @@ describe("width property is used", (): void => { test("width changes the size of the LED", (): void => { const renderedLed = renderLed({ width: 10 }); - expect(renderedLed.props.style.width).toBe("10px"); - expect(renderedLed.props.style.height).toBe("10px"); + // Width in CS-Studio doesn't quite match width in the browser, + // so whatever is input has 5 subtracted from it, this makes it + // look more like CS-Studio + expect(renderedLed.props.style.width).toBe("5px"); + expect(renderedLed.props.style.height).toBe("5px"); }); }); diff --git a/src/ui/widgets/LED/led.tsx b/src/ui/widgets/LED/led.tsx index f886603c..2aa5e401 100644 --- a/src/ui/widgets/LED/led.tsx +++ b/src/ui/widgets/LED/led.tsx @@ -39,8 +39,10 @@ export const LedComponent = (props: LedComponentProps): JSX.Element => { const style: any = {}; if (width) { - style.width = `${width}px`; - style.height = `${width}px`; + // make sizes similar to size in CS-Studio, five taken + // away from default in css file too + style.width = `${width - 5}px`; + style.height = `${width - 5}px`; } let allClasses = classes.Led;