Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions data/media/icons/horizontal-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ def _draw_vertical(self, ctx_text, min_size: int, show_grid: bool) -> None:
self.context.ctx.translate(-self.context.width, 0)

def px_per_tick_diagonal(self) -> float:
return (
self.px_per_tick_width
if self.context.width >= self.context.height
else self.px_per_tick_height
angle = math.atan2(self.context.height, self.context.width)
return math.sqrt(
self.px_per_tick_width**2 * math.cos(angle) ** 2
+ self.px_per_tick_height**2 * math.sin(angle) ** 2
)

def _draw_diag_1(self, ctx_text, min_size: int) -> None:
Expand Down