MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

Scale transforms do not render consistently

Open
#1,064 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Hacktoberfest
Dominant language
C#
Stars
16.3k
Forks
3.5k
Avg merge
1d 22h
Merged PRs (30d)
8

Description

Reproduction steps:
Apply a `ScaleTransform` to the `ContentControl` in the `MainWindow` of the demo app.
```XAML



```
The problem can be observed with most of the controls that have fine lines. ComboBox and TextBox both use the Underline control, and Slider is another obvious one. The issue is that the rendered thickness of these lines is inconsistent.

This problem is typically resolved with the [UseLayoutRounding](https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.uselayoutrounding?view=netframework-4.7.2) and [SnapToDevicePixels](https://docs.microsoft.com/en-us/dotnet/api/system.windows.uielement.snapstodevicepixels?view=netframework-4.7.2)

The "fix" for this may be partially or fully in the demo application, in which case those changes should be documented here.

![image](https://user-images.githubusercontent.com/952248/46753350-779f4780-cc74-11e8-9433-a9415233ada7.png)
![image](https://user-images.githubusercontent.com/952248/46753401-9ef61480-cc74-11e8-9c7f-98ac756f3b7b.png)
![image](https://user-images.githubusercontent.com/952248/46753424-aa494000-cc74-11e8-8b67-fec2ff24a152.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the demo app's MainWindow and reproduce the ScaleTransform on the ContentControl, then compare the fine-line rendering in Underline-based ComboBox and TextBox controls and Slider. Check whether UseLayoutRounding or SnapToDevicePixels resolves the inconsistency; done means the affected controls render consistent line thickness, with any demo-app changes documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.