Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ba1fa76

Browse filesBrowse files
committed
black
1 parent bd0a345 commit ba1fa76
Copy full SHA for ba1fa76

File tree

3 files changed

+36
-9
lines changed
Filter options

3 files changed

+36
-9
lines changed

‎fastplotlib/graphics/selectors/_base_selector.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/selectors/_base_selector.py
+25-5Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,12 @@ def _move_start(self, event_source: WorldObject, ev):
277277
"""
278278
position = self._plot_area.map_screen_to_world(ev)
279279

280-
self._move_info = MoveInfo(start_selection=None, start_position=position, delta=np.zeros_like(position), source=event_source)
280+
self._move_info = MoveInfo(
281+
start_selection=None,
282+
start_position=position,
283+
delta=np.zeros_like(position),
284+
source=event_source,
285+
)
281286
self._moving = True
282287

283288
self._initial_controller_state = self._plot_area.controller.enabled
@@ -361,12 +366,17 @@ def _move_to_pointer(self, ev):
361366
# use fill by default as the source, such as in region selectors
362367
if len(self._fill) > 0:
363368
move_info = MoveInfo(
364-
start_selection=None, start_position=None, delta=delta, source=self._fill[0]
369+
start_selection=None,
370+
start_position=None,
371+
delta=delta,
372+
source=self._fill[0],
365373
)
366374
# else use an edge, such as for linear selector
367375
else:
368376
move_info = MoveInfo(
369-
start_position=current_pos_world, last_position=current_pos_world, source=self._edges[0]
377+
start_position=current_pos_world,
378+
last_position=current_pos_world,
379+
source=self._edges[0],
370380
)
371381

372382
self._move_graphic(move_info)
@@ -405,10 +415,20 @@ def _key_hold(self):
405415
# set event source
406416
# use fill by default as the source
407417
if len(self._fill) > 0:
408-
move_info = MoveInfo(start_selection=None, start_position=None, delta=delta, source=self._fill[0])
418+
move_info = MoveInfo(
419+
start_selection=None,
420+
start_position=None,
421+
delta=delta,
422+
source=self._fill[0],
423+
)
409424
# else use an edge
410425
else:
411-
move_info = MoveInfo(start_selection=None, start_position=None, delta=delta, source=self._edges[0])
426+
move_info = MoveInfo(
427+
start_selection=None,
428+
start_position=None,
429+
delta=delta,
430+
source=self._edges[0],
431+
)
412432

413433
# move the graphic
414434
self._move_graphic(move_info)

‎fastplotlib/graphics/selectors/_polygon.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/selectors/_polygon.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ def _add_segment(self, ev):
6363
self._current_mode = "add"
6464

6565
position = self._plot_area.map_screen_to_world(ev)
66-
self._move_info = MoveInfo(start_selection=None, start_position=position, delta=np.zeros_like(position), source=None)
66+
self._move_info = MoveInfo(
67+
start_selection=None,
68+
start_position=position,
69+
delta=np.zeros_like(position),
70+
source=None,
71+
)
6772

6873
# line with same position for start and end until mouse moves
6974
data = np.array([position, position])

‎fastplotlib/graphics/selectors/_rectangle.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/selectors/_rectangle.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,14 @@ def get_selected_indices(
479479

480480
return ixs
481481

482-
def _move_graphic(self, move_info: MoveInfo):
482+
def _move_graphic(self, move_info: MoveInfo):
483483

484484
# If this the first move in this drag, store initial selection
485485
if move_info.start_selection is None:
486486
move_info.start_selection = self.selection
487487

488488
# add delta to current min, max to get new positions
489-
deltax, deltay = move_info.delta[0], move_info.delta[1]
489+
deltax, deltay = move_info.delta[0], move_info.delta[1]
490490

491491
# Get original selection
492492
xmin, xmax, ymin, ymax = move_info.start_selection
@@ -501,7 +501,9 @@ def _move_graphic(self, move_info: MoveInfo):
501501
deltax = np.clip(deltax, min_deltax, max_deltax)
502502
deltay = np.clip(deltay, min_deltay, max_deltay)
503503
# Update all bounds with equal amount
504-
self._selection.set_value(self, (xmin + deltax, xmax+ deltax, ymin + deltay, ymax+deltay))
504+
self._selection.set_value(
505+
self, (xmin + deltax, xmax + deltax, ymin + deltay, ymax + deltay)
506+
)
505507
return
506508

507509
# if selector not resizable return

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.