Skip to content
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

Fix DockPanel measuring bug #416

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

Poker-sang
Copy link
Contributor

Fixes

Fix DockPanel measuring bug

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

image

When set H/V Spacing and H/V Alignment is not Stretch, the last child on this orientation would be clipped. (The length of the clips is the length of the spacing.)

What is the new behavior?

image

PR Checklist

Please check if your PR fulfills the following requirements:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • New component
    • Documentation has been added
    • Sample in sample app has been added
    • Analyzers are passing for documentation and samples
    • Icon has been created (if new sample) following the Thumbnail Style Guide and templates
  • Tests for the changes have been added (if applicable)
  • Header has been added to all new source files
  • Contains NO breaking changes

Other information

@Arlodotexe
Copy link
Member

The error message from the CI:

"C:\a\Windows\Windows\CommunityToolkit.AllComponents.sln" (default target) (1:2) ->
"C:\a\Windows\Windows\tooling\ProjectHeads\AllComponents\Uwp\CommunityToolkit.App.Uwp.csproj" (default target) (57:6) ->
(BuildNativePackage target) -> 
  C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.12-rel-31116-00\tools\Microsoft.NetNative.targets(809,5): error : Internal compiler error: Object reference not set to an instance of an object. [C:\a\Windows\Windows\tooling\ProjectHeads\AllComponents\Uwp\CommunityToolkit.App.Uwp.csproj]

This seems to be transient, let's try a rerun.

@Arlodotexe Arlodotexe self-requested a review June 4, 2024 22:50
@Arlodotexe
Copy link
Member

Arlodotexe commented Jun 4, 2024

@Poker-sang I'm not able to reproduce the error using the information provided. Could you provide the code you used or the steps you took to produce the issue?

@Poker-sang
Copy link
Contributor Author

Poker-sang commented Jun 5, 2024

@Arlodotexe Sure, here is a simplest repro:

<controls:DockPanel LastChildFill="False">
    <controls:DockPanel Dock="Top" VerticalSpacing="100">
        <Rectangle
            Width="200"
            Height="200"
            Fill="Red" />
    </controls:DockPanel>
</controls:DockPanel>

Obviously the Rectangle.Height is actually Height - VerticalSpacing = 100.

image

@Arlodotexe
Copy link
Member

@Arlodotexe Sure, here is a simplest repro:

<controls:DockPanel LastChildFill="False">
    <controls:DockPanel Dock="Top" VerticalSpacing="100">
        <Rectangle
            Width="200"
            Height="200"
            Fill="Red" />
    </controls:DockPanel>
</controls:DockPanel>

Obviously the Rectangle.Height is actually Height - VerticalSpacing = 100.

image

Great, thank you @Poker-sang! I was able to reproduce the issue in our sample gallery, and can confirm that the code changes in this PR fix the issue without causing new ones.

@Arlodotexe Arlodotexe enabled auto-merge (squash) June 5, 2024 15:40
@Arlodotexe Arlodotexe merged commit efbaf96 into CommunityToolkit:main Jun 5, 2024
9 checks passed
@Poker-sang Poker-sang deleted the poker/fix-dockpanel branch June 5, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants