summarylogtreecommitdiffstats
path: root/0001-python-3.10-compatibility.patch
blob: f269e4774993825c281c036966e605a270b2e1ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
From e0e6d51f8ca1847801c2821b9f0dc5964dc460be Mon Sep 17 00:00:00 2001
From: Martin Petrus <martin.petrus@example.com>
Date: Tue, 4 Jan 2022 13:27:30 +0100
Subject: [PATCH] python 3.10 compatibility

---
 graphs/gui/vector.py                        | 26 ++++++++++-----------
 gui/builtinMarketBrowser/pfSearchBox.py     |  6 ++---
 gui/builtinShipBrowser/categoryItem.py      |  4 ++--
 gui/builtinShipBrowser/fitItem.py           | 16 ++++++-------
 gui/builtinShipBrowser/navigationPanel.py   |  6 ++---
 gui/builtinShipBrowser/pfListPane.py        | 12 +++++-----
 gui/builtinShipBrowser/pfWidgetContainer.py |  4 ++--
 gui/builtinShipBrowser/raceSelector.py      |  8 +++----
 gui/builtinShipBrowser/sfBrowserItem.py     |  6 ++---
 gui/builtinShipBrowser/shipItem.py          | 18 +++++++-------
 gui/chrome_tabs.py                          | 24 +++++++++----------
 gui/pyfa_gauge.py                           | 12 +++++-----
 gui/utils/anim.py                           |  2 +-
 gui/utils/color.py                          | 10 ++++----
 gui/utils/draw.py                           |  6 ++---
 15 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/graphs/gui/vector.py b/graphs/gui/vector.py
index 8542e7e8c..31c67478e 100644
--- a/graphs/gui/vector.py
+++ b/graphs/gui/vector.py
@@ -35,10 +35,10 @@ class VectorPicker(wx.Window):
         self._label = str(kwargs.pop('label', ''))
         self._labelpos = int(kwargs.pop('labelpos', 0))
         self._offset = float(kwargs.pop('offset', 0))
-        self._size = max(0, float(kwargs.pop('size', 50)))
+        self._size = max(0, int(kwargs.pop('size', 50)))
         self._directionOnly = kwargs.pop('directionOnly', False)
         super().__init__(*args, **kwargs)
-        self._fontsize = max(1, float(kwargs.pop('fontsize', 8 / self.GetContentScaleFactor())))
+        self._fontsize = int(max(1, kwargs.pop('fontsize', 8 / self.GetContentScaleFactor())))
         self._font = wx.Font(self._fontsize, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)
         self._angle = 0
         self.__length = 1
@@ -110,7 +110,7 @@ class VectorPicker(wx.Window):
     def GetScaledClientSize(self):
         return tuple([dim / self.GetContentScaleFactor() for dim in self.GetClientSize()])
 
-    def Draw(self, dc):
+    def Draw(self, dc: wx.BufferedPaintDC):
         width, height = self.GetScaledClientSize()
         if not width or not height:
             return
@@ -119,17 +119,17 @@ class VectorPicker(wx.Window):
         dc.SetTextForeground(wx.Colour(0))
         dc.SetFont(self._font)
 
-        radius = min(width, height) / 2 - 2
+        radius = int(min(width, height) / 2 - 2)
         dc.SetBrush(wx.WHITE_BRUSH)
         dc.DrawCircle(radius + 2, radius + 2, radius)
         a = math.radians(self._angle + self._offset)
-        x = math.cos(a) * radius
-        y = math.sin(a) * radius
+        x = int(math.cos(a) * radius)
+        y = int(math.sin(a) * radius)
         # See PR #2260 on why this is needed
-        pointRadius = 2 / self.GetContentScaleFactor() if 'wxGTK' in wx.PlatformInfo else 2
-        dc.DrawLine(radius + 2, radius + 2, radius + 2 + x * self._length, radius + 2 - y * self._length)
+        pointRadius = int(2 / self.GetContentScaleFactor() if 'wxGTK' in wx.PlatformInfo else 2)
+        dc.DrawLine(radius + 2, radius + 2, radius + 2 + x * int(self._length), radius + 2 - y * int(self._length))
         dc.SetBrush(wx.BLACK_BRUSH)
-        dc.DrawCircle(radius + 2 + x * self._length, radius + 2 - y * self._length, pointRadius)
+        dc.DrawCircle(int(radius + 2 + x * self._length), int(radius + 2 - y * self._length), pointRadius)
 
         if self._label:
             labelText = self._label
@@ -141,14 +141,14 @@ class VectorPicker(wx.Window):
         if not self._directionOnly:
             lengthText = '%d%%' % (100 * self._length,)
             lengthTextW, lengthTextH = dc.GetTextExtent(lengthText)
-            lengthTextX = radius + 2 + x / 2 - y / 3 - lengthTextW / 2
-            lengthTextY = radius + 2 - y / 2 - x / 3 - lengthTextH / 2
+            lengthTextX = radius + 2 + x // 2 - y // 3 - lengthTextW // 2
+            lengthTextY = radius + 2 - y // 2 - x // 3 - lengthTextH // 2
             dc.DrawText(lengthText, lengthTextX, lengthTextY)
 
         angleText = '%d\u00B0' % (self._angle,)
         angleTextW, angleTextH = dc.GetTextExtent(angleText)
-        angleTextX = radius + 2 - x / 2 - angleTextW / 2
-        angleTextY = radius + 2 + y / 2 - angleTextH / 2
+        angleTextX = radius + 2 - x // 2 - angleTextW // 2
+        angleTextY = radius + 2 + y // 2 - angleTextH // 2
         dc.DrawText(angleText, angleTextX, angleTextY)
 
     def OnEraseBackground(self, event):
diff --git a/gui/builtinMarketBrowser/pfSearchBox.py b/gui/builtinMarketBrowser/pfSearchBox.py
index d1e8f2f40..ea068a08f 100644
--- a/gui/builtinMarketBrowser/pfSearchBox.py
+++ b/gui/builtinMarketBrowser/pfSearchBox.py
@@ -220,15 +220,15 @@ class PFSearchBox(wx.Window):
         cheight = rect.height
 
         self.searchButtonX = self.padding
-        self.searchButtonY = (cheight - sh) / 2
+        self.searchButtonY = (cheight - sh) // 2
         self.cancelButtonX = cwidth - self.padding - cw
-        self.cancelButtonY = (cheight - ch) / 2
+        self.cancelButtonY = (cheight - ch) // 2
 
         self.editX = self.searchButtonX + self.padding + sw
 
         editWidth, editHeight = self.EditBox.GetSize()
 
-        self.editY = (cheight - editHeight) / 2
+        self.editY = (cheight - editHeight) // 2
         self.EditBox.SetPosition((self.editX, self.editY))
         self.EditBox.SetSize((self.cancelButtonX - self.padding - self.editX, -1))
 
diff --git a/gui/builtinShipBrowser/categoryItem.py b/gui/builtinShipBrowser/categoryItem.py
index b88557d22..d5559660a 100644
--- a/gui/builtinShipBrowser/categoryItem.py
+++ b/gui/builtinShipBrowser/categoryItem.py
@@ -85,7 +85,7 @@ class CategoryItem(SFBrowserItem):
     def UpdateElementsPos(self, mdc):
         rect = self.GetRect()
         self.shipBmpx = self.padding
-        self.shipBmpy = (rect.height - self.shipBmp.GetWidth()) / 2
+        self.shipBmpy = (rect.height - self.shipBmp.GetWidth()) // 2
 
         self.shipBmpx -= self.animCount
 
@@ -94,7 +94,7 @@ class CategoryItem(SFBrowserItem):
         wtext, htext = mdc.GetTextExtent(categoryName)
 
         self.catx = self.shipBmpx + self.shipBmp.GetWidth() + self.padding
-        self.caty = (rect.height - htext) / 2
+        self.caty = (rect.height - htext) // 2
 
     def DrawItem(self, mdc):
         # rect = self.GetRect()
diff --git a/gui/builtinShipBrowser/fitItem.py b/gui/builtinShipBrowser/fitItem.py
index bd37b0b94..3c2fdde5a 100644
--- a/gui/builtinShipBrowser/fitItem.py
+++ b/gui/builtinShipBrowser/fitItem.py
@@ -445,23 +445,23 @@ class FitItem(SFItem.SFBrowserItem):
         rect = self.GetRect()
 
         self.toolbarx = rect.width - self.toolbar.GetWidth() - self.padding
-        self.toolbary = (rect.height - self.toolbar.GetHeight()) / 2
+        self.toolbary = (rect.height - self.toolbar.GetHeight()) // 2
 
         self.toolbarx += self.animCount
 
-        self.shipEffx = self.padding + (rect.height - self.shipEffBk.GetWidth()) / 2
-        self.shipEffy = (rect.height - self.shipEffBk.GetHeight()) / 2
+        self.shipEffx = self.padding + (rect.height - self.shipEffBk.GetWidth()) // 2
+        self.shipEffy = (rect.height - self.shipEffBk.GetHeight()) // 2
 
         self.shipEffx -= self.animCount
 
-        self.shipBmpx = self.padding + (rect.height - self.shipBmp.GetWidth()) / 2
-        self.shipBmpy = (rect.height - self.shipBmp.GetHeight()) / 2
+        self.shipBmpx = self.padding + (rect.height - self.shipBmp.GetWidth()) // 2
+        self.shipBmpy = (rect.height - self.shipBmp.GetHeight()) // 2
 
         self.shipBmpx -= self.animCount
 
         self.textStartx = self.shipEffx + self.shipEffBk.GetWidth() + self.padding
 
-        self.fitNamey = (rect.height - self.shipBmp.GetHeight()) / 2
+        self.fitNamey = (rect.height - self.shipBmp.GetHeight()) // 2
 
         mdc.SetFont(self.fontBig)
         wtext, htext = mdc.GetTextExtent(self.fitName)
@@ -473,7 +473,7 @@ class FitItem(SFItem.SFBrowserItem):
         wlabel, hlabel = mdc.GetTextExtent(self.toolbar.hoverLabel)
 
         self.thoverx = self.toolbarx - self.padding - wlabel
-        self.thovery = (rect.height - hlabel) / 2
+        self.thovery = (rect.height - hlabel) // 2
         self.thoverw = wlabel
 
     def DrawItem(self, mdc):
@@ -529,7 +529,7 @@ class FitItem(SFItem.SFBrowserItem):
         fnEditSize = editCtl.GetSize()
         wSize = self.GetSize()
         fnEditPosX = end
-        fnEditPosY = (wSize.height - fnEditSize.height) / 2
+        fnEditPosY = (wSize.height - fnEditSize.height) // 2
         if fnEditPosX < start:
             editCtl.SetSize((self.editWidth + fnEditPosX - start, -1))
             editCtl.SetPosition((start, fnEditPosY))
diff --git a/gui/builtinShipBrowser/navigationPanel.py b/gui/builtinShipBrowser/navigationPanel.py
index 83dff8216..788795fc2 100644
--- a/gui/builtinShipBrowser/navigationPanel.py
+++ b/gui/builtinShipBrowser/navigationPanel.py
@@ -200,19 +200,19 @@ class NavigationPanel(SFItem.SFBrowserItem):
         rect = self.GetRect()
 
         self.toolbarx = self.padding
-        self.toolbary = (rect.height - self.toolbar.GetHeight()) / 2
+        self.toolbary = (rect.height - self.toolbar.GetHeight()) // 2
 
         mdc.SetFont(self.fontSmall)
 
         wlabel, hlabel = mdc.GetTextExtent(self.toolbar.hoverLabel)
 
         self.thoverx = self.toolbar.GetWidth() + self.padding
-        self.thovery = (rect.height - hlabel) / 2
+        self.thovery = (rect.height - hlabel) // 2
         self.thoverw = wlabel
 
         self.browserBoxX = self.thoverx
         bEditBoxWidth, bEditBoxHeight = self.BrowserSearchBox.GetSize()
-        self.browserBoxY = (rect.height - bEditBoxHeight) / 2
+        self.browserBoxY = (rect.height - bEditBoxHeight) // 2
 
         self.bEditBoxWidth = rect.width - self.browserBoxX - self.padding
 
diff --git a/gui/builtinShipBrowser/pfListPane.py b/gui/builtinShipBrowser/pfListPane.py
index ecb8edb1c..a78336b06 100644
--- a/gui/builtinShipBrowser/pfListPane.py
+++ b/gui/builtinShipBrowser/pfListPane.py
@@ -81,11 +81,11 @@ class PFListPane(wx.ScrolledWindow):
 
         # is it before the left edge?
         if cr.x < 0 < sppu_x:
-            new_vs_x = vs_x + (cr.x / sppu_x)
+            new_vs_x = vs_x + (cr.x // sppu_x)
 
         # is it above the top?
         if cr.y < 0 < sppu_y:
-            new_vs_y = vs_y + (cr.y / sppu_y)
+            new_vs_y = vs_y + (cr.y // sppu_y)
 
         # For the right and bottom edges, scroll enough to show the
         # whole control if possible, but if not just scroll such that
@@ -93,19 +93,19 @@ class PFListPane(wx.ScrolledWindow):
 
         # is it past the right edge ?
         if cr.right > clntsz.width and sppu_x > 0:
-            diff = (cr.right - clntsz.width + 1) / sppu_x
+            diff = (cr.right - clntsz.width + 1) // sppu_x
             if cr.x - diff * sppu_x > 0:
                 new_vs_x = vs_x + diff
             else:
-                new_vs_x = vs_x + (cr.x / sppu_x)
+                new_vs_x = vs_x + (cr.x // sppu_x)
 
         # is it below the bottom ?
         if cr.bottom > clntsz.height and sppu_y > 0:
-            diff = (cr.bottom - clntsz.height + 1) / sppu_y
+            diff = (cr.bottom - clntsz.height + 1) // sppu_y
             if cr.y - diff * sppu_y > 0:
                 new_vs_y = vs_y + diff
             else:
-                new_vs_y = vs_y + (cr.y / sppu_y)
+                new_vs_y = vs_y + (cr.y // sppu_y)
 
         # if we need to adjust
         if new_vs_x != -1 or new_vs_y != -1:
diff --git a/gui/builtinShipBrowser/pfWidgetContainer.py b/gui/builtinShipBrowser/pfWidgetContainer.py
index e3219530a..00c533610 100644
--- a/gui/builtinShipBrowser/pfWidgetContainer.py
+++ b/gui/builtinShipBrowser/pfWidgetContainer.py
@@ -15,8 +15,8 @@ class PFWidgetsContainer(PFListPane):
         if mode:
             aweight, aheight = self.anim.GetSize()
             cweight, cheight = self.GetSize()
-            ax = (cweight - aweight) / 2
-            ay = (cheight - aheight) / 2
+            ax = (cweight - aweight) // 2
+            ay = (cheight - aheight) // 2
             self.anim.SetPosition((ax, ay))
             self.anim.Show()
             self.anim.Play()
diff --git a/gui/builtinShipBrowser/raceSelector.py b/gui/builtinShipBrowser/raceSelector.py
index 809474249..3ec5990f1 100644
--- a/gui/builtinShipBrowser/raceSelector.py
+++ b/gui/builtinShipBrowser/raceSelector.py
@@ -116,8 +116,8 @@ class RaceSelector(wx.Window):
                 width += bmp.GetWidth() + self.buttonsPadding
                 height = max(bmp.GetHeight(), height)
 
-            posx = (rect.width - width) / 2
-            posy = (rect.height - height) / 2
+            posx = (rect.width - width) // 2
+            posy = (rect.height - height) // 2
 
             self.buttonsBarPos = (posx, posy)
 
@@ -208,11 +208,11 @@ class RaceSelector(wx.Window):
 
         if self.direction < 1:
             if self.layout == wx.VERTICAL:
-                mdc.DrawBitmap(self.bmpArrow, -2, (rect.height - self.bmpArrow.GetHeight()) / 2)
+                mdc.DrawBitmap(self.bmpArrow, -2, (rect.height - self.bmpArrow.GetHeight()) // 2)
             else:
                 mdc.SetPen(wx.Pen(sepColor, 1))
                 mdc.DrawLine(0, 0, rect.width, 0)
-                mdc.DrawBitmap(self.bmpArrow, (rect.width - self.bmpArrow.GetWidth()) / 2, -2)
+                mdc.DrawBitmap(self.bmpArrow, (rect.width - self.bmpArrow.GetWidth()) // 2, -2)
 
     def OnTimer(self, event):
         if event.GetId() == self.animTimerID:
diff --git a/gui/builtinShipBrowser/sfBrowserItem.py b/gui/builtinShipBrowser/sfBrowserItem.py
index 02fe03218..4e59c6c69 100644
--- a/gui/builtinShipBrowser/sfBrowserItem.py
+++ b/gui/builtinShipBrowser/sfBrowserItem.py
@@ -228,12 +228,12 @@ class PFToolbar:
 
             if btnState & BTN_PRESSED:
                 bmp = button.GetBitmap()
-                by += self.padding / 2
-                tbx += self.padding / 2
+                by += self.padding // 2
+                tbx += self.padding // 2
 
             bmpWidth = bmp.GetWidth()
 
-            pdc.DrawBitmap(dropShadowBmp, bx + self.padding / 2, self.toolbarY + self.padding / 2)
+            pdc.DrawBitmap(dropShadowBmp, bx + self.padding // 2, self.toolbarY + self.padding // 2)
             pdc.DrawBitmap(bmp, tbx, by)
 
             bx += bmpWidth + self.padding
diff --git a/gui/builtinShipBrowser/shipItem.py b/gui/builtinShipBrowser/shipItem.py
index 7c4d528d7..d220bf99a 100644
--- a/gui/builtinShipBrowser/shipItem.py
+++ b/gui/builtinShipBrowser/shipItem.py
@@ -194,26 +194,26 @@ class ShipItem(SFItem.SFBrowserItem):
         rect = self.GetRect()
 
         self.toolbarx = rect.width - self.toolbar.GetWidth() - self.padding
-        self.toolbary = (rect.height - self.toolbar.GetHeight()) / 2
+        self.toolbary = (rect.height - self.toolbar.GetHeight()) // 2
 
         self.toolbarx += self.animCount
 
-        self.shipEffx = self.padding + (rect.height - self.shipEffBk.GetWidth()) / 2
-        self.shipEffy = (rect.height - self.shipEffBk.GetHeight()) / 2
+        self.shipEffx = self.padding + (rect.height - self.shipEffBk.GetWidth()) // 2
+        self.shipEffy = (rect.height - self.shipEffBk.GetHeight()) // 2
 
         self.shipEffx -= self.animCount
 
-        self.shipBmpx = self.padding + (rect.height - self.shipBmp.GetWidth()) / 2
-        self.shipBmpy = (rect.height - self.shipBmp.GetHeight()) / 2
+        self.shipBmpx = self.padding + (rect.height - self.shipBmp.GetWidth()) // 2
+        self.shipBmpy = (rect.height - self.shipBmp.GetHeight()) // 2
 
         self.shipBmpx -= self.animCount
 
         self.raceBmpx = self.shipEffx + self.shipEffBk.GetWidth() + self.padding
-        self.raceBmpy = (rect.height - self.raceBmp.GetHeight()) / 2
+        self.raceBmpy = (rect.height - self.raceBmp.GetHeight()) // 2
 
         self.textStartx = self.raceBmpx + self.raceBmp.GetWidth() + self.padding
 
-        self.shipNamey = (rect.height - self.shipBmp.GetHeight()) / 2
+        self.shipNamey = (rect.height - self.shipBmp.GetHeight()) // 2
 
         shipName, shipTrait, fittings = self.shipFittingInfo
 
@@ -227,7 +227,7 @@ class ShipItem(SFItem.SFBrowserItem):
         wlabel, hlabel = mdc.GetTextExtent(self.toolbar.hoverLabel)
 
         self.thoverx = self.toolbarx - self.padding - wlabel
-        self.thovery = (rect.height - hlabel) / 2
+        self.thovery = (rect.height - hlabel) // 2
         self.thoverw = wlabel
 
     def DrawItem(self, mdc):
@@ -283,7 +283,7 @@ class ShipItem(SFItem.SFBrowserItem):
         fnEditSize = editCtl.GetSize()
         wSize = self.GetSize()
         fnEditPosX = end
-        fnEditPosY = (wSize.height - fnEditSize.height) / 2
+        fnEditPosY = (wSize.height - fnEditSize.height) // 2
         if fnEditPosX < start:
             editCtl.SetSize((self.editWidth + fnEditPosX - start, -1))
             editCtl.SetPosition((start, fnEditPosY))
diff --git a/gui/chrome_tabs.py b/gui/chrome_tabs.py
index 89687c33a..1dcdc4820 100644
--- a/gui/chrome_tabs.py
+++ b/gui/chrome_tabs.py
@@ -454,7 +454,7 @@ class _TabRenderer:
         mdc.SelectObject(ebmp)
         mdc.SetFont(self.font)
         textSizeX, textSizeY = mdc.GetTextExtent(self.text)
-        totalSize = self.left_width + self.right_width + textSizeX + self.close_btn_width / 2 + 16 + self.padding * 2
+        totalSize = self.left_width + self.right_width + textSizeX + self.close_btn_width // 2 + 16 + self.padding * 2
         mdc.SelectObject(wx.NullBitmap)
         return totalSize, self.tab_height
 
@@ -553,8 +553,8 @@ class _TabRenderer:
 
         x_offset = self.content_width \
             + self.left_width \
-            - self.ctab_close_bmp.GetWidth() / 2
-        y_offset = (self.tab_height - self.ctab_close_bmp.GetHeight()) / 2
+            - self.ctab_close_bmp.GetWidth() // 2
+        y_offset = (self.tab_height - self.ctab_close_bmp.GetHeight()) // 2
         self.close_region.Offset(x_offset, y_offset)
 
     def InitColors(self):
@@ -590,8 +590,8 @@ class _TabRenderer:
                 # Draw tab icon
                 mdc.DrawBitmap(
                     bmp,
-                    self.left_width + self.padding - bmp.GetWidth() / 2,
-                    (height - bmp.GetHeight()) / 2)
+                    self.left_width + self.padding - bmp.GetWidth() // 2,
+                    (height - bmp.GetHeight()) // 2)
 
         # draw close button
         if self.closeable:
@@ -604,8 +604,8 @@ class _TabRenderer:
 
             mdc.DrawBitmap(
                 cbmp,
-                self.content_width + self.left_width - cbmp.GetWidth() / 2,
-                (height - cbmp.GetHeight()) / 2)
+                self.content_width + self.left_width - cbmp.GetWidth() // 2,
+                (height - cbmp.GetHeight()) // 2)
 
         mdc.SelectObject(wx.NullBitmap)
 
@@ -625,7 +625,7 @@ class _TabRenderer:
         dc.SetFont(self.font)
 
         if self.tab_img:
-            text_start = self.left_width + self.padding + self.tab_img.GetWidth() / 2
+            text_start = self.left_width + self.padding + self.tab_img.GetWidth() // 2
         else:
             text_start = self.left_width
 
@@ -640,7 +640,7 @@ class _TabRenderer:
         # draw text (with no ellipses)
         text = draw.GetPartialText(dc, self.text, maxsize, "")
         tx, ty = dc.GetTextExtent(text)
-        dc.DrawText(text, text_start + self.padding, height / 2 - ty / 2)
+        dc.DrawText(text, text_start + self.padding, height // 2 - ty // 2)
 
     def __repr__(self):
         return "_TabRenderer(text={}, disabled={}) at {}".format(
@@ -1198,7 +1198,7 @@ class _TabsContainer(wx.Panel):
 
         if self.show_add_button:
             ax, ay = self.add_button.GetPosition()
-            mdc.DrawBitmap(self.add_button.Render(), ax, ay, True)
+            mdc.DrawBitmap(self.add_button.Render(), int(ax), int(ay), True)
 
         for i in range(len(self.tabs) - 1, -1, -1):
             tab = self.tabs[i]
@@ -1359,7 +1359,7 @@ class _TabsContainer(wx.Panel):
             # Divide tab container by number of tabs and add inclination. This will
             # return the ideal max size for the containers size
             if self.GetTabsCount() > 0:
-                dx = self.tab_container_width / self.GetTabsCount() + self.inclination * 2
+                dx = self.tab_container_width // self.GetTabsCount() + self.inclination * 2
                 tabWidth = min(dx, max_width)
 
             # Apply new size to all tabs
@@ -1391,7 +1391,7 @@ class _TabsContainer(wx.Panel):
             selected.SetPosition((selpos, self.container_height - self.height))
 
         self.add_button.SetPosition((round(tabsWidth) + self.inclination * 2,
-                                     self.container_height - self.height / 2 - self.add_button.GetHeight() / 3))
+                                     self.container_height - self.height // 2 - self.add_button.GetHeight() // 3))
 
     def OnLeaveWindow(self, event):
         if self.start_drag and not self.dragging:
diff --git a/gui/pyfa_gauge.py b/gui/pyfa_gauge.py
index cd83f3eca..e5542f841 100644
--- a/gui/pyfa_gauge.py
+++ b/gui/pyfa_gauge.py
@@ -255,7 +255,7 @@ class PyGauge(wx.Window):
             if value > 100:
                 w = rect.width
             else:
-                w = rect.width * (float(value) / 100)
+                w = int(rect.width * (float(value) / 100))
             r = copy.copy(rect)
             r.width = w
             dc.DrawRectangle(r)
@@ -267,7 +267,7 @@ class PyGauge(wx.Window):
             if value > 100:
                 w = rect.width
             else:
-                w = rect.width * (float(value) / 100)
+                w = int(rect.width * (float(value) / 100))
             r = copy.copy(rect)
             r.width = w
 
@@ -275,16 +275,16 @@ class PyGauge(wx.Window):
             # progress between the two transition ranges)
             pv = value
             if pv <= 100:
-                xv = pv / 100
+                xv = int(pv / 100)
                 transition = 0
             elif pv <= 101:
-                xv = pv - 100
+                xv = int(pv - 100)
                 transition = 1
             elif pv <= 103:
-                xv = (pv - 101) / 2
+                xv = int((pv - 101) / 2)
                 transition = 2
             elif pv <= 105:
-                xv = (pv - 103) / 2
+                xv = int((pv - 103) / 2)
                 transition = 3
             else:
                 pv = 106
diff --git a/gui/utils/anim.py b/gui/utils/anim.py
index 55d27c9ef..b9f63d642 100644
--- a/gui/utils/anim.py
+++ b/gui/utils/anim.py
@@ -62,7 +62,7 @@ class LoadAnimation(wx.Window):
         barColor = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
         shadeColor = colorUtils.GetSuitable(barColor, 0.75)
 
-        barWidth = rect.width / self.bars
+        barWidth = rect.width // self.bars
         barHeight = rect.height - self.padding * 2
 
         x = self.padding
diff --git a/gui/utils/color.py b/gui/utils/color.py
index f89b56d7a..7587cb01d 100644
--- a/gui/utils/color.py
+++ b/gui/utils/color.py
@@ -12,7 +12,7 @@ def Brighten(color, factor):
     b += (255 - b) * factor
     g += (255 - g) * factor
 
-    return wx.Colour(r, g, b, a)
+    return wx.Colour(int(r), int(g), int(b), a)
 
 
 def Darken(color, factor):
@@ -26,9 +26,9 @@ def Darken(color, factor):
     g *= factor
     b *= factor
 
-    r = min(max(r, 0), 255)
-    b = min(max(b, 0), 255)
-    g = min(max(g, 0), 255)
+    r = int(min(max(r, 0), 255))
+    b = int(min(max(b, 0), 255))
+    g = int(min(max(g, 0), 255))
 
     return wx.Colour(r, g, b, a)
 
@@ -70,4 +70,4 @@ def CalculateTransition(s_color, e_color, delta):
     tG = sG + (eG - sG) * delta
     tB = sB + (eB - sB) * delta
 
-    return wx.Colour(tR, tG, tB, (sA + eA) / 2)
+    return wx.Colour(tR, tG, tB, (sA + eA) // 2)
diff --git a/gui/utils/draw.py b/gui/utils/draw.py
index 4e486afda..95e975f32 100644
--- a/gui/utils/draw.py
+++ b/gui/utils/draw.py
@@ -13,7 +13,7 @@ def RenderGradientBar(windowColor, width, height, sFactor, eFactor, mFactor=None
     if mFactor:
         gMid = color.GetSuitable(windowColor, mFactor)
     else:
-        gMid = color.GetSuitable(windowColor, sFactor + (eFactor - sFactor) / 2)
+        gMid = color.GetSuitable(windowColor, sFactor + (eFactor - sFactor) // 2)
 
     gEnd = color.GetSuitable(windowColor, eFactor)
 
@@ -43,14 +43,14 @@ def DrawGradientBar(width, height, gStart, gEnd, gMid=None, fillRatio=4):
     mdc.SelectObject(canvas)
 
     r = wx.Rect(0, 0, width, height)
-    r.SetHeight(height / fillRatio)
+    r.SetHeight(height // fillRatio)
 
     if gMid is None:
         gMid = gStart
 
     mdc.GradientFillLinear(r, gStart, gMid, wx.SOUTH)
     r.SetTop(r.GetHeight())
-    r.SetHeight(height * (fillRatio - 1) / fillRatio + (1 if height % fillRatio != 0 else 0))
+    r.SetHeight(height * (fillRatio - 1) // fillRatio + (1 if height % fillRatio != 0 else 0))
 
     mdc.GradientFillLinear(r, gMid, gEnd, wx.SOUTH)
 
-- 
2.37.2