예제 #1
0
 public void crop_does_not_force_a_larger_height_than_current()
 {
     var element = new LayoutedElement(new Box(), Children.Empty) { ForcedInnerHeight = 2.cm() };
     var croppedElement = element.Crop(3.cm());
     croppedElement.OuterHeight.ShouldBe(2.cm());
 }
예제 #2
0
 public void crop_forces_max_height()
 {
     var element = new LayoutedElement(new Box { Margins = new Margins(1.cm(), 1.cm(), 1.cm(), 1.cm()) }, Children.Empty) { ForcedInnerHeight = 2.cm() };
     var croppedElement = element.Crop(2.cm());
     croppedElement.OuterHeight.ShouldBe(2.cm());
 }
예제 #3
0
 public void cropped_element_is_viewing_top_of_element()
 {
     var element = new LayoutedElement(new Box(), Children.Empty) { ForcedInnerHeight = 4.cm() };
     var result = element.Crop(3.cm());
     result.ViewportTop.ShouldBe(0.cm());
 }