Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
fix the lower case, add focus the whole geometries
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacZhangzhuo committed Oct 6, 2023
1 parent 1f97813 commit 8bfd9b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added `absolute_height` option to the `TextObject`.
* Added `font` option to `TextObject`.
* Multi-cursor visual effects.
* Added `F` key for focusing the selected objects.
* Added `F` key for focusing the selected objects. If no object is selected, it will focus the whole scene geometries.

### Changed

Expand Down
11 changes: 7 additions & 4 deletions src/compas_view2/views/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,12 @@ def keyPressEvent(self, event):
if key == QtCore.Qt.Key_Control:
self.app.selector.mode = "deselect"
self.keys["control"] = True
if key == QtCore.Qt.Key_F and self.app.selector.selected:
self.keys["F"] = True
self.camera.zoom_extents(self.app.selector.selected)
if key == QtCore.Qt.Key_F:
self.keys["f"] = True
if self.app.selector.selected:
self.camera.zoom_extents(self.app.selector.selected)
else:
self.camera.zoom_extents(self.objects)
self.update()

def keyReleaseEvent(self, event):
Expand All @@ -298,4 +301,4 @@ def keyReleaseEvent(self, event):
self.app.selector.mode = self.app.selector.overwrite_mode or "single"
self.keys["control"] = False
if key == QtCore.Qt.Key_F:
self.keys["F"] = False
self.keys["f"] = False

0 comments on commit 8bfd9b3

Please sign in to comment.