-
Notifications
You must be signed in to change notification settings - Fork 92
Bugfix/uum 141406 fixing action overlay behavior #672
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
base: master
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -53,6 +53,10 @@ | |
| floatField.tooltip = "Extrude Amount determines how far an edge will be moved along it's normal when extruding. This value can be negative."; | ||
| floatField.SetValueWithoutNotify(m_ExtrudeEdgeDistance); | ||
| floatField.RegisterCallback<ChangeEvent<float>>(OnExtrudeChanged); | ||
| PreviewActionManager.delayedPreviewChanged += () => | ||
|
Contributor
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. Subscribing to a static event ( You can avoid this by unsubscribing from the event when the element is detached from the panel. Suggested change (apply manually): System.Action onDelayedPreviewChanged = () =>
{
floatField.isDelayed = PreviewActionManager.delayedPreview;
};
PreviewActionManager.delayedPreviewChanged += onDelayedPreviewChanged;
root.RegisterCallback<DetachFromPanelEvent>(evt =>
{
PreviewActionManager.delayedPreviewChanged -= onDelayedPreviewChanged;
});🤖 Helpful? 👍/👎 by guardian |
||
| { | ||
| floatField.isDelayed = PreviewActionManager.delayedPreview; | ||
| }; | ||
| root.Add(floatField); | ||
|
|
||
| return root; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,11 @@ | |
| }); | ||
| root.Add(distanceField); | ||
|
|
||
| PreviewActionManager.delayedPreviewChanged += () => | ||
|
Contributor
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. Subscribing to a static event ( You can avoid this by unsubscribing from the event when the element is detached from the panel. Suggested change (apply manually): System.Action onDelayedPreviewChanged = () =>
{
distanceField.isDelayed = PreviewActionManager.delayedPreview;
};
PreviewActionManager.delayedPreviewChanged += onDelayedPreviewChanged;
root.RegisterCallback<DetachFromPanelEvent>(evt =>
{
PreviewActionManager.delayedPreviewChanged -= onDelayedPreviewChanged;
});🤖 Helpful? 👍/👎 by guardian |
||
| { | ||
| distanceField.isDelayed = PreviewActionManager.delayedPreview; | ||
| }; | ||
|
|
||
| return root; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,15 +62,19 @@ | |
|
|
||
| var distField = new Vector3Field("Translate"); | ||
| distField.SetValueWithoutNotify(dist); | ||
| if(PreviewActionManager.delayedPreview) | ||
| distField.Query<FloatField>().ForEach(ff => ff.isDelayed = true); | ||
| distField.Query<FloatField>().ForEach(ff => ff.isDelayed = PreviewActionManager.delayedPreview); | ||
| root.Add(distField); | ||
| distField.RegisterCallback<ChangeEvent<Vector3>>(evt => | ||
| { | ||
| s_Translation.SetValue(evt.newValue, true); | ||
| PreviewActionManager.UpdatePreview(); | ||
| }); | ||
|
|
||
| PreviewActionManager.delayedPreviewChanged += () => | ||
|
Contributor
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. Subscribing to a static event ( You can avoid this by unsubscribing from the event when the element is detached from the panel. Suggested change (apply manually): System.Action onDelayedPreviewChanged = () =>
{
distField.Query<FloatField>().ForEach(ff => ff.isDelayed = PreviewActionManager.delayedPreview);
};
PreviewActionManager.delayedPreviewChanged += onDelayedPreviewChanged;
root.RegisterCallback<DetachFromPanelEvent>(evt =>
{
PreviewActionManager.delayedPreviewChanged -= onDelayedPreviewChanged;
});🤖 Helpful? 👍/👎 by guardian |
||
| { | ||
| distField.Query<FloatField>().ForEach(ff => ff.isDelayed = PreviewActionManager.delayedPreview); | ||
| }; | ||
|
|
||
| return root; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,10 @@ | |
| m_SubdivCount.tooltip = tooltip; | ||
| m_SubdivCount.RegisterCallback<ChangeEvent<int>>(OnCountChanged); | ||
| m_SubdivCount.style.width = 40; | ||
| PreviewActionManager.delayedPreviewChanged += () => | ||
|
Contributor
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. Subscribing to a static event ( You can avoid this by unsubscribing from the event when the element is detached from the panel. Suggested change (apply manually): System.Action onDelayedPreviewChanged = () =>
{
m_SubdivCount.isDelayed = PreviewActionManager.delayedPreview;
};
PreviewActionManager.delayedPreviewChanged += onDelayedPreviewChanged;
root.RegisterCallback<DetachFromPanelEvent>(evt =>
{
PreviewActionManager.delayedPreviewChanged -= onDelayedPreviewChanged;
});🤖 Helpful? 👍/👎 by guardian |
||
| { | ||
| m_SubdivCount.isDelayed = PreviewActionManager.delayedPreview; | ||
| }; | ||
| line.Add(foldout); | ||
| line.Add(m_Slider); | ||
| line.Add(m_SubdivCount); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,10 @@ | |
| m_WeldDistance.SetValue(evt.newValue); | ||
| PreviewActionManager.UpdatePreview(); | ||
| }); | ||
| PreviewActionManager.delayedPreviewChanged += () => | ||
|
Contributor
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. Subscribing to a static event ( You can avoid this by unsubscribing from the event when the element is detached from the panel. Suggested change (apply manually): System.Action onDelayedPreviewChanged = () =>
{
floatField.isDelayed = PreviewActionManager.delayedPreview;
};
PreviewActionManager.delayedPreviewChanged += onDelayedPreviewChanged;
root.RegisterCallback<DetachFromPanelEvent>(evt =>
{
PreviewActionManager.delayedPreviewChanged -= onDelayedPreviewChanged;
});🤖 Helpful? 👍/👎 by guardian |
||
| { | ||
| floatField.isDelayed = PreviewActionManager.delayedPreview; | ||
| }; | ||
| root.Add(floatField); | ||
| return root; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,10 @@ | |
| m_GrowSelectionAngleIterative.SetValue(evt.newValue); | ||
| PreviewActionManager.UpdatePreview(); | ||
| }); | ||
|
|
||
| PreviewActionManager.delayedPreviewChanged += () => | ||
|
Contributor
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. Subscribing to a static event ( You can avoid this by unsubscribing from the event when the element is detached from the panel. Suggested change (apply manually): System.Action onDelayedPreviewChanged = () =>
{
floatField.isDelayed = PreviewActionManager.delayedPreview;
};
PreviewActionManager.delayedPreviewChanged += onDelayedPreviewChanged;
root.RegisterCallback<DetachFromPanelEvent>(evt =>
{
PreviewActionManager.delayedPreviewChanged -= onDelayedPreviewChanged;
});🤖 Helpful? 👍/👎 by guardian |
||
| { | ||
| floatField.isDelayed = PreviewActionManager.delayedPreview; | ||
| }; | ||
| return root; | ||
| } | ||
|
|
||
|
|
||
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.
Subscribing to a static event (
PreviewActionManager.delayedPreviewChanged) using an anonymous delegate insideCreateSettingsContentwill cause a memory leak. Because static events hold strong references to their subscribers, thefloatField(and the entire parent VisualElement tree) will be kept alive in memory indefinitely even after the settings content is destroyed.To prevent this, you should unsubscribe from the event when the visual element is detached. Have you considered registering a callback on the
DetachFromPanelEventto clean up the subscription?Suggested change (apply manually):
🤖 Helpful? 👍/👎 by guardian