-
Notifications
You must be signed in to change notification settings - Fork 73
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
Anti-alias the edges of masks and mattes for a smoother result. #176
Conversation
The default BorderMode for Visuals is Inherit, and if not specified the value Hard (i.e. not anti-aliased) is passed into the root. The default worked for us previously because the desktop tree sets the BorderMode to Soft and we inherit it so we got Soft behavior everywhere. However the trees created for masks and mattes are not rooted in the desktop, so they were getting set to Hard and some edges looked aliased. This change adds the ability to set the BorderMode and sets it to Soft for the trees created for masks and mattes.
@@ -670,9 +670,21 @@ Visual TranslateAndApplyMasks(TranslationContext context, ReadOnlySpan<Mask> mas | |||
// the visual we want captured by the visual surface has a parent to use as the | |||
// origin of its offsets. | |||
var sourceIntermediateParent = _c.CreateContainerVisual(); | |||
|
|||
// Because this the root of a tree, the BorderMode is not inherited and |
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.
typo, here and below. #Closed
source/WinCompData/Visual.cs
Outdated
@@ -16,6 +16,10 @@ private protected Visual() | |||
{ | |||
} | |||
|
|||
// Defaults to Inherit. For trees rooted are set to Soft. |
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.
typo #Closed
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.
The default BorderMode for Visuals is Inherit, and if not specified the value Hard (i.e. not anti-aliased) is passed into the root.
The default worked for us previously because the desktop tree sets the BorderMode to Soft and we inherit it so we got Soft behavior everywhere.
However the trees created for masks and mattes are not rooted in the desktop, so they were getting set to Hard and some edges looked aliased.
This change adds the ability to set the BorderMode and sets it to Soft for the trees created for masks and mattes.