Example #1
0
 public static void GetBorderThickness(Style aStyle, SideCut aCut, out int aLeft, out int aTop, out int aRight, out int aBottom)
 {
     aLeft = aRight = aTop = aBottom = 0;
     if ((aCut & SideCut.Left) != SideCut.Left)
     {
         aLeft = aStyle.XThickness;
     }
     if ((aCut & SideCut.Right) != SideCut.Right)
     {
         aRight = aStyle.XThickness;
     }
     if ((aCut & SideCut.Top) != SideCut.Top)
     {
         aTop = aStyle.YThickness;
     }
     if ((aCut & SideCut.Bottom) != SideCut.Bottom)
     {
         aBottom = aStyle.YThickness;
     }
 }
		private static Cairo.Rectangle ExpandAreaByStyle (Style aStyle, Cairo.Rectangle aArea, SideCut aCut, int aFactor)
		{
			double areaX = aArea.X;
			double areaY = aArea.Y; 
			double areaWidth = aArea.Width;
			double areaHeight = aArea.Height;

			int xThick = (aStyle.XThickness * aFactor);
			int yThick = (aStyle.YThickness * aFactor);
			
			if ((aCut & SideCut.Left) == SideCut.Left) {
				areaX -= xThick;
				areaWidth += xThick;
			}
			if ((aCut & SideCut.Right) == SideCut.Right)
				areaWidth +=xThick;
			if ((aCut & SideCut.Top) == SideCut.Top) {
				areaY -= yThick;
				areaHeight += yThick;
			}
			if ((aCut & SideCut.Bottom) == SideCut.Bottom)
				areaHeight += yThick;
			
			return (new Cairo.Rectangle (areaX, areaY, areaWidth, areaHeight));
		}
		public static Cairo.Rectangle GetChildAreaByStyle (Style aStyle, Cairo.Rectangle aArea, SideCut aCut)
		{
			return (ExpandAreaByStyle (aStyle, aArea, aCut, 1));
		}
		public static void GetBorderThickness (Style aStyle, SideCut aCut, out int aLeft, out int aTop, out int aRight, out int aBottom)
		{
			aLeft = aRight = aTop = aBottom = 0;
			if ((aCut & SideCut.Left) != SideCut.Left)
			    aLeft = aStyle.XThickness;
			if ((aCut & SideCut.Right) != SideCut.Right)
			    aRight = aStyle.XThickness;
			if ((aCut & SideCut.Top) != SideCut.Top)
			    aTop = aStyle.YThickness;
			if ((aCut & SideCut.Bottom) != SideCut.Bottom)
			    aBottom = aStyle.YThickness;
		}
Example #5
0
        private static Cairo.Rectangle ExpandAreaByStyle(Style aStyle, Cairo.Rectangle aArea, SideCut aCut, int aFactor)
        {
            double areaX      = aArea.X;
            double areaY      = aArea.Y;
            double areaWidth  = aArea.Width;
            double areaHeight = aArea.Height;

            int xThick = (aStyle.XThickness * aFactor);
            int yThick = (aStyle.YThickness * aFactor);

            if ((aCut & SideCut.Left) == SideCut.Left)
            {
                areaX     -= xThick;
                areaWidth += xThick;
            }
            if ((aCut & SideCut.Right) == SideCut.Right)
            {
                areaWidth += xThick;
            }
            if ((aCut & SideCut.Top) == SideCut.Top)
            {
                areaY      -= yThick;
                areaHeight += yThick;
            }
            if ((aCut & SideCut.Bottom) == SideCut.Bottom)
            {
                areaHeight += yThick;
            }

            return(new Cairo.Rectangle(areaX, areaY, areaWidth, areaHeight));
        }
Example #6
0
 public static Cairo.Rectangle GetChildAreaByStyle(Style aStyle, Cairo.Rectangle aArea, SideCut aCut)
 {
     return(ExpandAreaByStyle(aStyle, aArea, aCut, 1));
 }