-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: property if DrawingArea clips children #4473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -570,7 +570,7 @@ class DrawingArea(OffsetBox): | |
""" | ||
The DrawingArea can contain any Artist as a child. The DrawingArea | ||
has a fixed width and height. The position of children relative to | ||
the parent is fixed. The children can be clipped at the | ||
the parent is fixed. The children can be clipped at the | ||
boundaries of the parent. | ||
""" | ||
|
||
|
@@ -596,6 +596,19 @@ def __init__(self, width, height, xdescent=0., | |
|
||
self.dpi_transform = mtransforms.Affine2D() | ||
|
||
@property | ||
def clip_children(self): | ||
""" | ||
If the children of this DrawingArea should be clipped | ||
by DrawingArea bounding box. | ||
""" | ||
return self._clip_children | ||
|
||
@clip_children.setter | ||
def clip_children(self, val): | ||
self._clip_children = bool(val) | ||
self.stale = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is only stale if the state changes, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but there are only a few checks anywhere else. This problem will either be solved if we go with a managed attributes meta-class (i.e. traitlets) or slowly as it annoys people. |
||
|
||
def get_transform(self): | ||
""" | ||
Return the :class:`~matplotlib.transforms.Transform` applied | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs docstring