Merge remote-tracking branch 'origin/master'

# Conflicts:
#	examples/simple_example.py
This commit is contained in:
Tom Schimansky 2022-04-21 20:31:37 +02:00
commit c3c7d1a5de
2 changed files with 5 additions and 6 deletions

View File

@ -77,7 +77,7 @@ class ScalingTracker:
DPI100pc = 96 # DPI 96 is 100% scaling
DPI_type = 0 # MDT_EFFECTIVE_DPI = 0, MDT_ANGULAR_DPI = 1, MDT_RAW_DPI = 2
window_hwnd = wintypes.HWND(window)
window_hwnd = wintypes.HWND(window.winfo_id())
monitor_handle = windll.user32.MonitorFromWindow(window_hwnd, wintypes.DWORD(2)) # MONITOR_DEFAULTTONEAREST = 2
x_dpi, y_dpi = wintypes.UINT(), wintypes.UINT()
windll.shcore.GetDpiForMonitor(monitor_handle, DPI_type, pointer(x_dpi), pointer(y_dpi))

View File

@ -12,11 +12,10 @@ class CTkCanvas(tkinter.Canvas):
self.aa_circle_canvas_ids = set()
def get_char_from_radius(self, radius):
if CTkSettings.scaling_factor == 1:
if radius >= 20:
return "A"
else:
return self.radius_to_char_fine[radius]
if radius >= 20:
return "A"
else:
return self.radius_to_char_fine[radius]
def create_aa_circle(self, x_pos, y_pos, radius, angle=0, fill="white", tags="", anchor=tkinter.CENTER) -> str:
# create a circle with a font element