@@ -948,6 +948,10 @@ public void Renderer_MarpitLeftAlignmentKeyword_RendersImageAtLeftEdgeOfFrame()
948948 // Marpit:  floats the image to the left of the content area.
949949 // The "left" keyword is stripped from alt text; the image is placed at the left
950950 // edge of its allocated content frame (xAlign = 0.0).
951+ //
952+ // With default theme padding (Left=60 lu) and a 1×1 image in a 840×220 lu frame,
953+ // CalculateImagePlacement gives X = 60 lu, width = height = 220 lu.
954+ // In EMU (×12700): X = 762000, Cx = Cy = 2794000.
951955 using var workspace = TestWorkspace . Create ( ) ;
952956
953957 workspace . WriteFile ( "photo.png" , Convert . FromBase64String ( OnePxPngBase64 ) ) ;
@@ -971,6 +975,12 @@ public void Renderer_MarpitLeftAlignmentKeyword_RendersImageAtLeftEdgeOfFrame()
971975 var picture = Assert . Single ( slidePart . Slide ! . Descendants < P . Picture > ( ) ) ;
972976 var description = picture . NonVisualPictureProperties ? . NonVisualDrawingProperties ? . Description ? . Value ;
973977 Assert . Equal ( string . Empty , description ) ;
978+
979+ // Left alignment: image X should be at the content frame's left edge (frame.X = 60 lu = 762000 EMU).
980+ var transform = picture . ShapeProperties ! . GetFirstChild < A . Transform2D > ( ) ! ;
981+ Assert . Equal ( 762000L , transform . Offset ! . X ! . Value ) ;
982+ Assert . Equal ( 2794000L , transform . Extents ! . Cx ! . Value ) ;
983+ Assert . Equal ( 2794000L , transform . Extents ! . Cy ! . Value ) ;
974984 }
975985
976986 [ Fact ]
@@ -979,6 +989,10 @@ public void Renderer_MarpitRightAlignmentKeyword_RendersImageAtRightEdgeOfFrame(
979989 // Marpit:  floats the image to the right of the content area.
980990 // The "right" keyword is stripped from alt text; the image is placed at the right
981991 // edge of its allocated content frame (xAlign = 1.0).
992+ //
993+ // With default theme padding (Left=60 lu) and a 1×1 image in an 840×220 lu frame,
994+ // gapX = 840 - 220 = 620 lu, so X = 60 + 620 = 680 lu → 8636000 EMU.
995+ // Width = height = 220 lu → 2794000 EMU.
982996 using var workspace = TestWorkspace . Create ( ) ;
983997
984998 workspace . WriteFile ( "photo.png" , Convert . FromBase64String ( OnePxPngBase64 ) ) ;
@@ -1002,6 +1016,13 @@ public void Renderer_MarpitRightAlignmentKeyword_RendersImageAtRightEdgeOfFrame(
10021016 var picture = Assert . Single ( slidePart . Slide ! . Descendants < P . Picture > ( ) ) ;
10031017 var description = picture . NonVisualPictureProperties ? . NonVisualDrawingProperties ? . Description ? . Value ;
10041018 Assert . Equal ( string . Empty , description ) ;
1019+
1020+ // Right alignment: gapX = frameWidth - fittedWidth = 840 - 220 = 620 lu,
1021+ // so X = frame.X + gapX = 60 + 620 = 680 lu → 8636000 EMU.
1022+ var transform = picture . ShapeProperties ! . GetFirstChild < A . Transform2D > ( ) ! ;
1023+ Assert . Equal ( 8636000L , transform . Offset ! . X ! . Value ) ;
1024+ Assert . Equal ( 2794000L , transform . Extents ! . Cx ! . Value ) ;
1025+ Assert . Equal ( 2794000L , transform . Extents ! . Cy ! . Value ) ;
10051026 }
10061027
10071028 [ Fact ]
0 commit comments