StevensDeptECE / GrailGUI

GrailGUI is a prototype of a replacement for web programming (HTTP, HTML, CSS, JavaScript) and GUI programming. It includes a client graphical API, a browser implemented in C++ and OpenGL, a protocol to transmit metadata and data in binary, a language (XDL) to describe the binary data, and local storage to retain data on the client should that be necessary. Encrypted communications (equivalent of TLS) have not yet been implemented.
GNU General Public License v3.0
7 stars 14 forks source link

Remove Styles from styled multishapes #18

Open dkrautha opened 3 years ago

dkrautha commented 3 years ago

As of now styled multi shapes are forced on taking a Style, but the only thing they use from it is the line width. Besides that one number, a styled multi shape is capable of putting color on anything it draws. A line width should be a variable internal to styled multi shapes, and potentially be something that could be changed after creation depending on how SMS actually uses the line width it got from the style.

ahuston-0 commented 3 years ago

Given that StyledMultiShape2D::render just grabs the line width from the Style and uses it once, we should be able to just make line width a class variable. The biggest side effect of this will be that changing the line width will redraw the entire multishape to that new line width, but I think that was already how StyledMultiShape2D worked. We can implement this as a private class variable. I'd suggest not making it constant, as this would prevent us from changing the thickness of lines after the initial creation, and instead use a setter to change the line width and check that it is within acceptable bounds for a line width.

However, this will likely require rewriting a large chunk of anything that currently uses a style to set line width. This will probably include most of the tests

ahuston-0 commented 3 years ago

Note: fixing this would allow us to fix and close #10

ahuston-0 commented 3 years ago

Need to investigate the following: