draw()

in client/client/modules/render/heatmap/renderer/checkbox-button/index.js [220:258]


    draw() {
        const visible = this.visible && this.valid;
        if (this.inactiveLabel) {
            this.inactiveLabel.visible = !this.hovered && !this.enabled && visible;
        }
        if (this.inactiveHoveredLabel) {
            this.inactiveHoveredLabel.visible = this.hovered && !this.enabled && visible;
        }
        if (this.activeHoveredLabel) {
            this.activeHoveredLabel.visible = this.hovered && this.enabled && visible;
        }
        if (this.activeLabel) {
            this.activeLabel.visible = !this.hovered && this.enabled && visible;
        }
        if (this.graphics) {
            this.graphics.clear();
            if (visible) {
                let buttonConfig = config.inactive;
                if (this.hovered && this.enabled) {
                    buttonConfig = config.activeHovered;
                } else if (this.hovered && !this.enabled) {
                    buttonConfig = config.inactiveHovered;
                } else if (this.enabled) {
                    buttonConfig = config.active;
                }
                this.graphics
                    .beginFill(buttonConfig.background, buttonConfig.alpha)
                    .lineStyle(1, buttonConfig.stroke, 1)
                    .drawRoundedRect(
                        config.margin,
                        config.margin,
                        this.labelWidth,
                        this.labelHeight,
                        config.borderRadius
                    )
                    .endFill();
            }
        }
    }