@@ -72,7 +72,7 @@ def __init__(self):
72
72
self .arrow_stroke_width = 10
73
73
self .arrow_tip_shape = m .StealthTip
74
74
self .font_weight = m .BOLD
75
-
75
+
76
76
def init_repo (self ):
77
77
try :
78
78
self .repo = Repo (search_parent_directories = True )
@@ -292,7 +292,14 @@ def draw_commit(self, commit, i, prevCircle, shift=numpy.array([0.0, 0.0, 0.0]))
292
292
)
293
293
end = self .drawnCommits [commit .hexsha ].get_center ()
294
294
295
- arrow = m .Arrow (start , end , color = self .fontColor , stroke_width = self .arrow_stroke_width , tip_shape = self .arrow_tip_shape , max_stroke_width_to_length_ratio = 1000 )
295
+ arrow = m .Arrow (
296
+ start ,
297
+ end ,
298
+ color = self .fontColor ,
299
+ stroke_width = self .arrow_stroke_width ,
300
+ tip_shape = self .arrow_tip_shape ,
301
+ max_stroke_width_to_length_ratio = 1000 ,
302
+ )
296
303
297
304
if commit == "dark" :
298
305
arrow = m .Arrow (
@@ -311,7 +318,13 @@ def draw_commit(self, commit, i, prevCircle, shift=numpy.array([0.0, 0.0, 0.0]))
311
318
for commitCircle in self .drawnCommits .values ():
312
319
inter = m .Intersection (lineRect , commitCircle )
313
320
if inter .has_points ():
314
- arrow = m .CurvedArrow (start , end , color = self .fontColor , stroke_width = self .arrow_stroke_width , tip_shape = self .arrow_tip_shape )
321
+ arrow = m .CurvedArrow (
322
+ start ,
323
+ end ,
324
+ color = self .fontColor ,
325
+ stroke_width = self .arrow_stroke_width ,
326
+ tip_shape = self .arrow_tip_shape ,
327
+ )
315
328
if start [1 ] == end [1 ]:
316
329
arrow .shift (m .UP * 1.25 )
317
330
if start [0 ] < end [0 ] and start [1 ] == end [1 ]:
@@ -332,7 +345,10 @@ def draw_commit(self, commit, i, prevCircle, shift=numpy.array([0.0, 0.0, 0.0]))
332
345
font = "Monospace" ,
333
346
font_size = 20 if settings .highlight_commit_messages else 14 ,
334
347
color = self .fontColor ,
335
- weight = m .BOLD if settings .highlight_commit_messages or settings .style == StyleOptions .THICK else m .NORMAL ,
348
+ weight = m .BOLD
349
+ if settings .highlight_commit_messages
350
+ or settings .style == StyleOptions .THICK
351
+ else m .NORMAL ,
336
352
).next_to (circle , m .DOWN )
337
353
338
354
if settings .animate and commit != "dark" and isNewCommit :
@@ -385,7 +401,13 @@ def get_nonparent_branch_names(self):
385
401
def build_commit_id_and_message (self , commit , i ):
386
402
hide_refs = False
387
403
if commit == "dark" :
388
- commitId = m .Text ("" , font = "Monospace" , font_size = 20 , color = self .fontColor , weight = self .font_weight )
404
+ commitId = m .Text (
405
+ "" ,
406
+ font = "Monospace" ,
407
+ font_size = 20 ,
408
+ color = self .fontColor ,
409
+ weight = self .font_weight ,
410
+ )
389
411
commitMessage = ""
390
412
else :
391
413
commitId = m .Text (
@@ -410,7 +432,11 @@ def draw_head(self, commit, i, commitId):
410
432
else :
411
433
headbox .next_to (commitId , m .UP )
412
434
headText = m .Text (
413
- "HEAD" , font = "Monospace" , font_size = 20 , color = self .fontColor , weight = self .font_weight ,
435
+ "HEAD" ,
436
+ font = "Monospace" ,
437
+ font_size = 20 ,
438
+ color = self .fontColor ,
439
+ weight = self .font_weight ,
414
440
).move_to (headbox .get_center ())
415
441
416
442
head = m .VGroup (headbox , headText )
@@ -457,7 +483,11 @@ def draw_branch(self, commit, i, make_branches_remote=False):
457
483
)
458
484
459
485
branchText = m .Text (
460
- text , font = "Monospace" , font_size = 20 , color = self .fontColor , weight = self .font_weight ,
486
+ text ,
487
+ font = "Monospace" ,
488
+ font_size = 20 ,
489
+ color = self .fontColor ,
490
+ weight = self .font_weight ,
461
491
)
462
492
branchRec = m .Rectangle (
463
493
color = m .GREEN ,
@@ -1002,7 +1032,10 @@ def setup_and_draw_parent(
1002
1032
color = m .RED ,
1003
1033
):
1004
1034
circle = m .Circle (
1005
- stroke_color = color , stroke_width = self .commit_stroke_width , fill_color = color , fill_opacity = self .ref_fill_opacity
1035
+ stroke_color = color ,
1036
+ stroke_width = self .commit_stroke_width ,
1037
+ fill_color = color ,
1038
+ fill_opacity = self .ref_fill_opacity ,
1006
1039
)
1007
1040
circle .height = 1
1008
1041
circle .next_to (
@@ -1014,12 +1047,23 @@ def setup_and_draw_parent(
1014
1047
1015
1048
start = circle .get_center ()
1016
1049
end = self .drawnCommits [child .hexsha ].get_center ()
1017
- arrow = m .Arrow (start , end , color = self .fontColor , stroke_width = self .arrow_stroke_width , tip_shape = self .arrow_tip_shape , max_stroke_width_to_length_ratio = 1000 )
1050
+ arrow = m .Arrow (
1051
+ start ,
1052
+ end ,
1053
+ color = self .fontColor ,
1054
+ stroke_width = self .arrow_stroke_width ,
1055
+ tip_shape = self .arrow_tip_shape ,
1056
+ max_stroke_width_to_length_ratio = 1000 ,
1057
+ )
1018
1058
length = numpy .linalg .norm (start - end ) - (1.5 if start [1 ] == end [1 ] else 3 )
1019
1059
arrow .set_length (length )
1020
1060
1021
1061
commitId = m .Text (
1022
- "abcdef" , font = "Monospace" , font_size = 20 , color = self .fontColor , weight = self .font_weight ,
1062
+ "abcdef" ,
1063
+ font = "Monospace" ,
1064
+ font_size = 20 ,
1065
+ color = self .fontColor ,
1066
+ weight = self .font_weight ,
1023
1067
).next_to (circle , m .UP )
1024
1068
self .toFadeOut .add (commitId )
1025
1069
@@ -1079,7 +1123,13 @@ def get_nondark_commits(self):
1079
1123
return nondark_commits
1080
1124
1081
1125
def draw_ref (self , commit , top , i = 0 , text = "HEAD" , color = m .BLUE ):
1082
- refText = m .Text (text , font = "Monospace" , font_size = 20 , color = self .fontColor , weight = self .font_weight )
1126
+ refText = m .Text (
1127
+ text ,
1128
+ font = "Monospace" ,
1129
+ font_size = 20 ,
1130
+ color = self .fontColor ,
1131
+ weight = self .font_weight ,
1132
+ )
1083
1133
refbox = m .Rectangle (
1084
1134
color = color ,
1085
1135
fill_color = color ,
0 commit comments