Skip to content

How can I fix visual artifacts when drawing elements? #2757

@bananaspirit-nasonov

Description

@bananaspirit-nasonov

The image shows that CTkSwitch has a strange rounding, which I tried to fix by going through different parameters and sizes, but nothing helped. Also, if CTkButton is set to border, then the button will also be drawn with artifacts.
Image

please help me figure out the reason, these artifacts make my app terrible.

Here is the configuration of the button and switch:

toggle_switch_btn = ctk.CTkSwitch(
            self,
            text="",
            command=self.toggle_switch_event,
            variable=self.switch_var,
            onvalue="on",
            offvalue="off",
            switch_width=200,
            switch_height=100,
            # corner_radius=200,
            progress_color="#FF7F3A",  # Зеленый цвет когда включен
            button_color="white",
            fg_color="#919191"
        )
        self.toggle_switch_btn.place(x=10, y=10)
calib_btn = ctk.CTkButton(
            self,
            text="Калибровать",
            width=180,
            height=45,
            corner_radius=20,
            fg_color="#D9D9D9",
            text_color="black",
            border_width=1,
            border_color="black",
            font=ctk.CTkFont(size=20),
            border_spacing=2,
            hover=True,
            hover_color="#E8E8E8",
            command=lambda: self.controller.show_frame(CalibrationPage),
        )
        calib_btn.place(x=60, y=194)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions