MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

ColorPicker

Open MasterProger opened this issue 3 years ago • 3 comments

Bug explanation

When calling the DragDelta event on the Thump element, an error occurs if the Thump element is captured from the edge and dragged. We need to remove the error.

I fixed the bug by adding code in my project

private void SpectrumPickerThumb_DragDelta(object sender, DragDeltaEventArgs e) { var thumb = e.Source as Thumb; var left = Canvas.GetLeft(thumb) + e.HorizontalChange + startThumbOffset.X; var top = Canvas.GetTop(thumb) + e.VerticalChange + startThumbOffset.Y; ApplyThumbPosition(left, top); }

private void PART_SpectrumPickerThumb_DragStarted(object sender, DragStartedEventArgs e) { startThumbOffset.X = e.HorizontalOffset; startThumbOffset.Y = e.VerticalOffset; }

private void PART_SpectrumCanvas_MouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { if (!PART_SpectrumPickerThumb.IsDragging) { var position = e.GetPosition(SpectrumCanvas); ApplyThumbPosition(position.X, position.Y); } } }

Version

4.5.0

MasterProger avatar May 27 '22 12:05 MasterProger

Required return value Hsb Instead of the double value 0.1xxxxx, you want to return an integer value from 0 to 100

MasterProger avatar May 28 '22 12:05 MasterProger

What is the Thumb element? Do you mean Slider ?

ElieTaillard avatar May 30 '22 08:05 ElieTaillard

What is the Thumb element? Do you mean Slider ?

A circle in the canvas element that we define and choose a color.

MasterProger avatar Jun 01 '22 16:06 MasterProger

@MasterProger Could the issues you are/were experience possibly have been solved by PR #2895 which is included in the latest release? I cannot seem to find an exact match of the code you provided, but the code changed in the PR is very similar, and thus could possibly be what you were referring to?!

nicolaihenriksen avatar Jan 13 '23 20:01 nicolaihenriksen

This issue is marked stale because it has been open 30 days with no activity. Remove stale label or update the issue, otherwise it will be closed in 14 days.

github-actions[bot] avatar Apr 21 '23 01:04 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar May 06 '23 01:05 github-actions[bot]