0

In the following code part is Part class's object which is inherited from ScatterViewItem class (Microsoft.Surface.Presentation.Controls). part.Content is Path geometry:

GeometryGroup gGroup = new GeometryGroup
{
    FillRule = FillRule.Nonzero
};
foreach(KeyValuePair<int, Part> kv in Layers)
{
    geom = part.ShadowPath.RenderedGeometry.Clone();
    geom.Transform = new TranslateTransform(0, 0);
    gGroup.Children.Add(geom);
}

When I comment geom.Transform = new TranslateTransform(0, 0); line, it shows with right scale but when I uncomment it, although I am not changing anything, it scales paths: enter image description here

I want to know how to fix it.

ekad
  • 14,436
  • 26
  • 44
  • 46
Bahriddin Abdiev
  • 328
  • 1
  • 14
  • Did you check the value of `geom.Transform` before you assigned a new value? – Clemens Feb 09 '18 at 06:41
  • @Clemens, yes it was one MatrixTranslate was there. I just got it and modified OffsetX and OffsetY properties. I can mark as a right answer if you write it. #Thanks – Bahriddin Abdiev Feb 12 '18 at 09:18

1 Answers1

0

@Clemens was right about initial transformation values: there was matrixTransform with automatically calculated values by WPF. When I assigned new transformation values, it totally removed old values. I just picked that matrix and updated some values and it worked fine.

Bahriddin Abdiev
  • 328
  • 1
  • 14