Skip to content

Commit cf7b90d

Browse files
authored
Path improvements (#56)
1 parent 148d38b commit cf7b90d

File tree

12 files changed

+2905
-62
lines changed

12 files changed

+2905
-62
lines changed

cmake/yup_modules.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ endfunction()
162162
#==============================================================================
163163

164164
function (_yup_module_setup_target module_name
165+
module_path
165166
module_cpp_standard
166167
module_include_paths
167168
module_options
@@ -289,6 +290,7 @@ function (_yup_module_setup_plugin_client target_name plugin_client_target folde
289290
endif()
290291

291292
_yup_module_setup_target ("${custom_target_name}"
293+
"${module_path}"
292294
"${module_cpp_standard}"
293295
"${module_include_paths}"
294296
"${module_options}"
@@ -524,6 +526,7 @@ function (yup_add_module module_path module_group)
524526

525527
# ==== Setup module sources and properties
526528
_yup_module_setup_target ("${module_name}"
529+
"${module_path}"
527530
"${module_cpp_standard}"
528531
"${module_include_paths}"
529532
"${module_options}"

examples/graphics/source/examples/Audio.h

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,42 +123,33 @@ class Oscilloscope : public yup::Component
123123
for (std::size_t i = 1; i < renderData.size(); ++i)
124124
path.lineTo (i * xSize, (renderData[i] + 1.0f) * 0.5f * getHeight());
125125

126-
// Outermost glow layer
127-
g.setStrokeColor (lineColor.withAlpha (0.1f));
128-
g.setStrokeWidth (12.0f);
129-
g.setStrokeCap (yup::StrokeCap::Round);
130-
g.setStrokeJoin (yup::StrokeJoin::Round);
131-
g.strokePath (path);
126+
filledPath = path.createStrokePolygon(4.0f);
132127

133-
// Second glow layer
134-
g.setStrokeColor (lineColor.withAlpha (0.2f));
135-
g.setStrokeWidth (8.0f);
136-
g.strokePath (path);
128+
g.setFillColor (lineColor);
129+
g.setFeather (8.0f);
130+
g.fillPath (filledPath);
137131

138-
// Third glow layer
139-
g.setStrokeColor (lineColor.withAlpha (0.4f));
140-
g.setStrokeWidth (5.0f);
141-
g.strokePath (path);
132+
g.setFillColor (lineColor.brighter (0.2f));
133+
g.setFeather (4.0f);
134+
g.fillPath (filledPath);
142135

143-
// Main stroke
144136
g.setStrokeColor (lineColor.withAlpha (0.8f));
145-
g.setStrokeWidth (2.5f);
137+
g.setStrokeWidth (2.0f);
146138
g.strokePath (path);
147139

148-
// Bright center line
149140
g.setStrokeColor (lineColor.brighter (0.3f));
150141
g.setStrokeWidth (1.0f);
151142
g.strokePath (path);
152143

153-
// Ultra-bright core
154144
g.setStrokeColor (yup::Colors::white.withAlpha (0.9f));
155-
g.setStrokeWidth (0.3f);
145+
g.setStrokeWidth (0.5f);
156146
g.strokePath (path);
157147
}
158148

159149
private:
160150
std::vector<float> renderData;
161151
yup::Path path;
152+
yup::Path filledPath;
162153
};
163154

164155
//==============================================================================

0 commit comments

Comments
 (0)