public borders(css_borders val) { left = new border(val.left); right = new border(val.right); top = new border(val.top); bottom = new border(val.bottom); front = new border(val.front); //:h3ml back = new border(val.back); //:h3ml radius = default(border_radiuses); }
public borders(borders val) { left = val.left; right = val.right; top = val.top; bottom = val.bottom; front = val.front; //:h3ml back = val.back; //:h3ml radius = val.radius; }
public int bottom_left_z; //:h3ml public border_radiuses(border_radiuses val) { top_left_x = val.top_left_x; top_left_y = val.top_left_y; top_left_z = val.top_left_z; //:h3ml top_right_x = val.top_right_x; top_right_y = val.top_right_y; top_right_z = val.top_right_z; //:h3ml bottom_right_x = val.bottom_right_x; bottom_right_y = val.bottom_right_y; bottom_right_z = val.bottom_right_z; //:h3ml bottom_left_x = val.bottom_left_x; bottom_left_y = val.bottom_left_y; bottom_left_z = val.bottom_left_z; //:h3ml }
public background_paint(background_paint val) { image = val.image; baseurl = val.baseurl; attachment = val.attachment; repeat = val.repeat; color = val.color; clip_box = val.clip_box; origin_box = val.origin_box; border_box = val.border_box; border_radius = val.border_radius; image_size = val.image_size; position_x = val.position_x; position_y = val.position_y; position_z = val.position_z; //:h3ml is_root = val.is_root; }
public void set_clip(position pos, border_radiuses bdr_radius, bool valid_x, bool valid_y) { var clip_pos = pos; get_client_rect(out var client_pos); if (!valid_x) { clip_pos.x = client_pos.x; clip_pos.width = client_pos.width; } if (!valid_y) { clip_pos.y = client_pos.y; clip_pos.height = client_pos.height; } _clips.Add(clip_pos); }
public void set_clip(position pos, border_radiuses bdr_radius, bool valid_x, bool valid_y) { }
protected override void DrawBackground(UIntPtr hdc, string image, background_repeat repeat, ref web_color color, ref position pos, ref border_radiuses br, ref position borderBox, bool isRoot) { if (pos.width > 0 && pos.height > 0) { if (!String.IsNullOrEmpty(image)) { var bitmap = LoadImage(image); if (bitmap != null) { DrawImage(bitmap, new Rect(pos.x, pos.y, pos.width, pos.height)); } } else { Rect rect = new Rect(pos.x, pos.y, pos.width, pos.height); var geometry = new PathGeometry(); PathSegmentCollection path = new PathSegmentCollection(); path.Add(new LineSegment(new Point(rect.Right - br.top_right_x, rect.Top), false)); path.Add(new QuadraticBezierSegment(new Point(rect.Right, rect.Top), new Point(rect.Right, rect.Top + br.top_right_y), false)); path.Add(new LineSegment(new Point(rect.Right, rect.Bottom - br.bottom_right_y), false)); path.Add(new QuadraticBezierSegment(new Point(rect.Right, rect.Bottom), new Point(rect.Right - br.bottom_right_x, rect.Bottom), false)); path.Add(new LineSegment(new Point(rect.Left + br.bottom_left_x, rect.Bottom), false)); path.Add(new QuadraticBezierSegment(new Point(rect.Left, rect.Bottom), new Point(rect.Left, rect.Bottom - br.bottom_left_y), false)); path.Add(new LineSegment(new Point(rect.Left, rect.Top + br.top_left_y), false)); path.Add(new QuadraticBezierSegment(new Point(rect.Left, rect.Top), new Point(rect.Left + br.top_left_x, rect.Top), false)); geometry.Figures.Add(new PathFigure(new Point(rect.Left + br.top_left_x, rect.Top), path, true)); DrawingContext.DrawGeometry(color.GetBrush(), null, geometry); } } }
protected override void DrawBackground(UIntPtr hdc, string image, background_repeat repeat, ref web_color color, ref position pos, ref border_radiuses br, ref position borderBox, bool isRoot) { var cgColor = color.ToCGColor(); var rect = pos.ToRect(); if (string.IsNullOrEmpty(image)) { CGPath path = new CGPath(); path.MoveToPoint(rect.Left + br.top_left_x, rect.Top); path.AddLineToPoint(rect.Right - br.top_right_x, rect.Top); path.AddQuadCurveToPoint(rect.Right, rect.Top, rect.Right, rect.Top + br.top_right_y); path.AddLineToPoint(rect.Right, rect.Bottom - br.bottom_right_y); path.AddQuadCurveToPoint(rect.Right, rect.Bottom, rect.Right - br.bottom_right_x, rect.Bottom); path.AddLineToPoint(rect.Left + br.bottom_left_x, rect.Bottom); path.AddQuadCurveToPoint(rect.Left, rect.Bottom, rect.Left, rect.Bottom - br.bottom_left_y); path.AddLineToPoint(rect.Left, rect.Top + br.top_left_y); path.AddQuadCurveToPoint(rect.Left, rect.Top, rect.Left + br.top_left_x, rect.Top); Context.SetFillColor(cgColor); Context.AddPath(path); Context.FillPath(); } else { DrawImage(image, rect); } }