Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border style unfinished #104

Open
ArtHome12 opened this issue Oct 4, 2018 · 1 comment
Open

Border style unfinished #104

ArtHome12 opened this issue Oct 4, 2018 · 1 comment

Comments

@ArtHome12
Copy link
Contributor

ArtHome12 commented Oct 4, 2018

The library understands separate styles for the top, right, bottom and left lines of the border, different types of fill (groove, ridge, etc.), but the drawing is implemented primitively - the same as top border and only solid.
The existing code of Sources\UI\Style\style_background_renderer.cpp:

	void StyleBackgroundRenderer::render_border()
	{
		int num_layers = style.array_size("background-image");
		if (!get_layer_clip(num_layers - 1).is_keyword("border-box"))
			return;

		StyleGetValue style_top = style.computed_value("border-top-style");
		if (style_top.is_keyword("solid"))
		{
			Colorf color = style.computed_value("border-top-color").color();
			if (color.a > 0.0f)
			{
				auto border_points = get_border_points();
				auto padding_points = get_padding_points(border_points);
				Path border_path = get_border_stroke_path(border_points, padding_points);
				border_path.fill(canvas, Brush(color));
			}
		}
	}

It is necessary to implement:

  • separate border drawing (top, left, right, bottom);
  • support for all styles (thin, medium, thick, dotted, dashed, double, groove, ridge, inset, outset).

Maybe someone has already done this in his code and just need to copy-paste?

@rombust
Copy link
Collaborator

rombust commented Oct 24, 2018

I believe that Judas did some work on border top/bottom/left/right in his UICORE github project.

If i remember correctly it wasn't ported to clanlib because there maybe performance issues for drawing simple borders. (This hasn't been checked).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants