xbintsc 0.5.31 → 0.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -16
- package/README.zh-CN.md +10 -8
- package/dist/scripts/check-version.d.ts +27 -0
- package/dist/scripts/check-version.js +71 -0
- package/dist/scripts/check-version.js.map +1 -0
- package/dist/scripts/package-platform.d.ts +58 -0
- package/dist/scripts/package-platform.js +142 -0
- package/dist/scripts/package-platform.js.map +1 -0
- package/dist/scripts/verify-platform-package.d.ts +34 -0
- package/dist/scripts/verify-platform-package.js +161 -0
- package/dist/scripts/verify-platform-package.js.map +1 -0
- package/dist/src/binder/references.js +14 -1
- package/dist/src/binder/references.js.map +1 -1
- package/dist/src/cli/help.d.ts +1 -1
- package/dist/src/cli/main.js +3 -1
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/codegen/generator/module.d.ts +1 -0
- package/dist/src/codegen/generator/module.js +54 -0
- package/dist/src/codegen/generator/module.js.map +1 -1
- package/dist/src/codegen/generator/statements/variables.js +6 -4
- package/dist/src/codegen/generator/statements/variables.js.map +1 -1
- package/dist/src/driver/runtime-lib.d.ts +29 -4
- package/dist/src/driver/runtime-lib.js +68 -10
- package/dist/src/driver/runtime-lib.js.map +1 -1
- package/dist/src/driver/version.d.ts +1 -1
- package/dist/src/driver/version.js +1 -1
- package/dist/src/extensions/gui/css.d.ts +26 -0
- package/dist/src/extensions/gui/css.js +100 -0
- package/dist/src/extensions/gui/css.js.map +1 -0
- package/dist/src/extensions/gui/html.js +9 -2
- package/dist/src/extensions/gui/html.js.map +1 -1
- package/dist/src/extensions/gui/index.js +22 -7
- package/dist/src/extensions/gui/index.js.map +1 -1
- package/dist/src/extensions/gui/three.d.ts +16 -0
- package/dist/src/extensions/gui/three.js +22 -0
- package/dist/src/extensions/gui/three.js.map +1 -0
- package/dist/src/extensions/media/index.d.ts +6 -5
- package/dist/src/extensions/media/index.js +15 -16
- package/dist/src/extensions/media/index.js.map +1 -1
- package/dist/src/parser/context.d.ts +41 -0
- package/dist/src/parser/context.js +89 -4
- package/dist/src/parser/context.js.map +1 -1
- package/dist/src/parser/literals.js +6 -12
- package/dist/src/parser/literals.js.map +1 -1
- package/dist/tests/driver/platform-package.test.d.ts +1 -0
- package/dist/tests/driver/platform-package.test.js +49 -0
- package/dist/tests/driver/platform-package.test.js.map +1 -0
- package/dist/tests/driver/runtime-lib.test.js +51 -4
- package/dist/tests/driver/runtime-lib.test.js.map +1 -1
- package/dist/tests/e2e/compile-builtins.test.js +24 -0
- package/dist/tests/e2e/compile-builtins.test.js.map +1 -1
- package/dist/tests/e2e/compile-objects-classes.test.js +23 -0
- package/dist/tests/e2e/compile-objects-classes.test.js.map +1 -1
- package/dist/tests/e2e/gui-audio.test.d.ts +14 -0
- package/dist/tests/e2e/gui-audio.test.js +287 -0
- package/dist/tests/e2e/gui-audio.test.js.map +1 -0
- package/dist/tests/e2e/gui-browser.test.js +1 -1
- package/dist/tests/e2e/gui-browser.test.js.map +1 -1
- package/dist/tests/e2e/gui-effects.test.d.ts +6 -0
- package/dist/tests/e2e/gui-effects.test.js +262 -0
- package/dist/tests/e2e/gui-effects.test.js.map +1 -0
- package/dist/tests/e2e/gui-example-webgl.test.d.ts +10 -0
- package/dist/tests/e2e/gui-example-webgl.test.js +75 -0
- package/dist/tests/e2e/gui-example-webgl.test.js.map +1 -0
- package/dist/tests/e2e/gui-example-webgl2.test.d.ts +8 -0
- package/dist/tests/e2e/gui-example-webgl2.test.js +72 -0
- package/dist/tests/e2e/gui-example-webgl2.test.js.map +1 -0
- package/dist/tests/e2e/gui-helpers.d.ts +7 -0
- package/dist/tests/e2e/gui-helpers.js +1 -0
- package/dist/tests/e2e/gui-helpers.js.map +1 -1
- package/dist/tests/e2e/gui-layout.test.js +48 -0
- package/dist/tests/e2e/gui-layout.test.js.map +1 -1
- package/dist/tests/e2e/gui-media.test.js +83 -4
- package/dist/tests/e2e/gui-media.test.js.map +1 -1
- package/dist/tests/e2e/gui-style.test.js +55 -0
- package/dist/tests/e2e/gui-style.test.js.map +1 -1
- package/dist/tests/e2e/gui-webgl.test.d.ts +11 -0
- package/dist/tests/e2e/gui-webgl.test.js +437 -0
- package/dist/tests/e2e/gui-webgl.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2-3d.test.d.ts +4 -0
- package/dist/tests/e2e/gui-webgl2-3d.test.js +264 -0
- package/dist/tests/e2e/gui-webgl2-3d.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2-blit.test.d.ts +10 -0
- package/dist/tests/e2e/gui-webgl2-blit.test.js +262 -0
- package/dist/tests/e2e/gui-webgl2-blit.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2-formats.test.d.ts +6 -0
- package/dist/tests/e2e/gui-webgl2-formats.test.js +395 -0
- package/dist/tests/e2e/gui-webgl2-formats.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2-mrt.test.d.ts +4 -0
- package/dist/tests/e2e/gui-webgl2-mrt.test.js +105 -0
- package/dist/tests/e2e/gui-webgl2-mrt.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2-ubo.test.d.ts +8 -0
- package/dist/tests/e2e/gui-webgl2-ubo.test.js +112 -0
- package/dist/tests/e2e/gui-webgl2-ubo.test.js.map +1 -0
- package/dist/tests/e2e/gui-webgl2.test.d.ts +10 -0
- package/dist/tests/e2e/gui-webgl2.test.js +282 -0
- package/dist/tests/e2e/gui-webgl2.test.js.map +1 -0
- package/dist/tests/extensions/gui-index.test.js +1 -0
- package/dist/tests/extensions/gui-index.test.js.map +1 -1
- package/dist/tests/extensions/gui.test.js +41 -0
- package/dist/tests/extensions/gui.test.js.map +1 -1
- package/dist/tests/extensions/media.test.js +8 -3
- package/dist/tests/extensions/media.test.js.map +1 -1
- package/dist/tests/parser/expressions.test.js +30 -0
- package/dist/tests/parser/expressions.test.js.map +1 -1
- package/dist/tests/platform-tarball.test.d.ts +1 -0
- package/dist/tests/platform-tarball.test.js +111 -0
- package/dist/tests/platform-tarball.test.js.map +1 -0
- package/dist/tests/version.test.js +6 -0
- package/dist/tests/version.test.js.map +1 -1
- package/doc/ai/contributing.md +11 -0
- package/doc/ai/extensions.md +35 -12
- package/doc/ai/troubleshooting.md +17 -11
- package/doc/ai/zh-CN/contributing.md +9 -0
- package/doc/ai/zh-CN/extensions.md +30 -10
- package/doc/ai/zh-CN/troubleshooting.md +14 -8
- package/doc/gui/api.md +63 -14
- package/doc/gui/build.md +79 -16
- package/doc/gui/canvas.md +11 -3
- package/doc/gui/dom.md +35 -17
- package/doc/gui/known-issues.md +57 -24
- package/doc/gui/layout.md +18 -0
- package/doc/gui/media.md +21 -13
- package/doc/gui/rendering.md +50 -3
- package/doc/gui/webgl.md +315 -0
- package/doc/gui.md +113 -18
- package/doc/npm-package.md +59 -29
- package/doc/requirements.md +24 -11
- package/doc/zh-CN/gui/api.md +53 -11
- package/doc/zh-CN/gui/build.md +70 -16
- package/doc/zh-CN/gui/canvas.md +9 -2
- package/doc/zh-CN/gui/dom.md +22 -7
- package/doc/zh-CN/gui/known-issues.md +45 -19
- package/doc/zh-CN/gui/layout.md +14 -0
- package/doc/zh-CN/gui/media.md +18 -11
- package/doc/zh-CN/gui/rendering.md +41 -4
- package/doc/zh-CN/gui/webgl.md +121 -0
- package/doc/zh-CN/gui.md +91 -15
- package/doc/zh-CN/npm-package.md +48 -24
- package/doc/zh-CN/requirements.md +16 -7
- package/llms.txt +2 -0
- package/package.json +17 -1
- package/runtime/ext_gui/audio.cpp +365 -153
- package/runtime/ext_gui/audio_buffer.cpp +166 -0
- package/runtime/ext_gui/audio_buffer.h +37 -0
- package/runtime/ext_gui/audio_decode.cpp +219 -0
- package/runtime/ext_gui/audio_decode.h +39 -0
- package/runtime/ext_gui/audio_device.cpp +87 -0
- package/runtime/ext_gui/audio_effects.cpp +163 -0
- package/runtime/ext_gui/audio_effects.h +25 -0
- package/runtime/ext_gui/audio_internal.h +30 -0
- package/runtime/ext_gui/audio_mixer.cpp +494 -0
- package/runtime/ext_gui/audio_mixer.h +238 -0
- package/runtime/ext_gui/audio_param.cpp +104 -0
- package/runtime/ext_gui/audio_param_object.cpp +155 -0
- package/runtime/ext_gui/browser.cpp +50 -14
- package/runtime/ext_gui/canvas.cpp +3 -18
- package/runtime/ext_gui/canvas_internal.h +10 -0
- package/runtime/ext_gui/canvas_raster.cpp +60 -0
- package/runtime/ext_gui/clip_values.cpp +246 -0
- package/runtime/ext_gui/css.cpp +94 -0
- package/runtime/ext_gui/css.h +22 -1
- package/runtime/ext_gui/css_match.cpp +3 -0
- package/runtime/ext_gui/css_selector.cpp +30 -3
- package/runtime/ext_gui/css_sheet.cpp +89 -45
- package/runtime/ext_gui/document.cpp +4 -1
- package/runtime/ext_gui/document.h +2 -0
- package/runtime/ext_gui/dom.h +16 -0
- package/runtime/ext_gui/dom_api.cpp +1 -0
- package/runtime/ext_gui/dom_api_canvas.cpp +17 -80
- package/runtime/ext_gui/dom_api_canvas_extra.cpp +130 -1
- package/runtime/ext_gui/dom_api_canvas_pending.cpp +41 -0
- package/runtime/ext_gui/dom_api_internal.h +275 -0
- package/runtime/ext_gui/dom_api_webgl.cpp +383 -0
- package/runtime/ext_gui/dom_api_webgl2.cpp +549 -0
- package/runtime/ext_gui/dom_api_webgl2_draw.cpp +269 -0
- package/runtime/ext_gui/dom_api_webgl_buffer.cpp +216 -0
- package/runtime/ext_gui/dom_api_webgl_compressed.cpp +167 -0
- package/runtime/ext_gui/dom_api_webgl_framebuffer.cpp +160 -0
- package/runtime/ext_gui/dom_api_webgl_rt.h +30 -0
- package/runtime/ext_gui/dom_api_webgl_shader.cpp +443 -0
- package/runtime/ext_gui/dom_api_webgl_source.cpp +161 -0
- package/runtime/ext_gui/dom_api_webgl_state.cpp +590 -0
- package/runtime/ext_gui/dom_api_webgl_texture.cpp +485 -0
- package/runtime/ext_gui/dom_api_webgl_ubo.cpp +81 -0
- package/runtime/ext_gui/effect_values.cpp +312 -0
- package/runtime/ext_gui/gradient_values.cpp +476 -0
- package/runtime/ext_gui/grid_values.cpp +230 -0
- package/runtime/ext_gui/gui.cpp +44 -9
- package/runtime/ext_gui/gui_canvas.cpp +50 -2
- package/runtime/ext_gui/gui_engine.h +36 -4
- package/runtime/ext_gui/gui_events.cpp +4 -1
- package/runtime/ext_gui/gui_media.cpp +1 -1
- package/runtime/ext_gui/gui_webgl.cpp +83 -0
- package/runtime/ext_gui/image_bitmap.cpp +28 -0
- package/runtime/ext_gui/image_bitmap.h +26 -0
- package/runtime/ext_gui/image_bitmap_browser.cpp +136 -0
- package/runtime/ext_gui/layout.cpp +21 -0
- package/runtime/ext_gui/layout_flow.cpp +81 -4
- package/runtime/ext_gui/layout_flow_internal.h +31 -0
- package/runtime/ext_gui/layout_grid.cpp +374 -0
- package/runtime/ext_gui/media.cpp +32 -0
- package/runtime/ext_gui/media.h +14 -1
- package/runtime/ext_gui/media_api.h +25 -2
- package/runtime/ext_gui/media_query.cpp +211 -0
- package/runtime/ext_gui/paint.cpp +111 -77
- package/runtime/ext_gui/paint.h +33 -3
- package/runtime/ext_gui/paint_background.cpp +229 -0
- package/runtime/ext_gui/paint_clip.cpp +268 -0
- package/runtime/ext_gui/paint_effects.cpp +324 -0
- package/runtime/ext_gui/paint_internal.h +85 -0
- package/runtime/ext_gui/renderer.cpp +8 -31
- package/runtime/ext_gui/renderer_clip.cpp +196 -0
- package/runtime/ext_gui/renderer_image.cpp +13 -8
- package/runtime/ext_gui/renderer_internal.h +15 -8
- package/runtime/ext_gui/renderer_text.cpp +6 -31
- package/runtime/ext_gui/style.cpp +343 -20
- package/runtime/ext_gui/style.h +144 -3
- package/runtime/ext_gui/style_print.cpp +134 -1
- package/runtime/ext_gui/style_values.cpp +152 -126
- package/runtime/ext_gui/style_values_internal.h +35 -0
- package/runtime/ext_gui/webgl.h +600 -0
- package/runtime/ext_gui/webgl2_constants.h +274 -0
- package/runtime/ext_gui/webgl_blit.cpp +95 -0
- package/runtime/ext_gui/webgl_buffer.cpp +480 -0
- package/runtime/ext_gui/webgl_buffer_objects.cpp +270 -0
- package/runtime/ext_gui/webgl_clear.cpp +142 -0
- package/runtime/ext_gui/webgl_compressed.cpp +180 -0
- package/runtime/ext_gui/webgl_constants.h +317 -0
- package/runtime/ext_gui/webgl_context.cpp +551 -0
- package/runtime/ext_gui/webgl_draw.cpp +560 -0
- package/runtime/ext_gui/webgl_draw_buffers.cpp +75 -0
- package/runtime/ext_gui/webgl_glsl.h +165 -0
- package/runtime/ext_gui/webgl_glsl_compile.cpp +437 -0
- package/runtime/ext_gui/webgl_glsl_rewrite.cpp +367 -0
- package/runtime/ext_gui/webgl_glsl_scan.cpp +590 -0
- package/runtime/ext_gui/webgl_glsl_scan_block.cpp +126 -0
- package/runtime/ext_gui/webgl_glsl_tokens.h +28 -0
- package/runtime/ext_gui/webgl_msl.cpp +62 -0
- package/runtime/ext_gui/webgl_msl.h +33 -0
- package/runtime/ext_gui/webgl_pipeline.cpp +326 -0
- package/runtime/ext_gui/webgl_program_blocks.cpp +58 -0
- package/runtime/ext_gui/webgl_program_internal.h +24 -0
- package/runtime/ext_gui/webgl_shader.cpp +594 -0
- package/runtime/ext_gui/webgl_state.cpp +228 -0
- package/runtime/ext_gui/webgl_texture.cpp +420 -0
- package/runtime/ext_gui/webgl_texture_3d.cpp +215 -0
- package/runtime/ext_gui/webgl_uniform.cpp +167 -0
- package/runtime/ext_gui/webgl_uniform_block.h +31 -0
- package/runtime/ext_gui/webgl_webgl2.cpp +277 -0
- package/runtime/ext_media/decode_audio.cpp +308 -0
- package/runtime/ext_media/media.cpp +1 -1
- package/runtime/ext_media/media_bridge.c +11 -3
- package/runtime/rt.h +17 -0
- package/runtime/rt_internal.h +1 -0
- package/runtime/xt_array_buffer.c +30 -0
- package/runtime/xt_containers/access.inc +8 -0
- package/runtime/xt_regex/api.inc +2 -0
- package/runtime/xt_regex/matcher.inc +16 -3
- package/runtime/xt_regex/parser.inc +8 -2
- package/runtime/xt_regex/types.inc +3 -0
- package/runtime/xt_stdlib2/regexp-match.inc +60 -21
- package/runtime/xt_stdlib2/regexp.inc +1 -0
- package/runtime/xt_typed_array/elements.inc +13 -0
- package/runtime/xt_typed_array.c +1 -1
- package/scripts/build-gui.ts +90 -3
- package/scripts/build-media.ts +335 -62
- package/scripts/build-runtime.ts +21 -16
- package/scripts/check-version.ts +39 -9
- package/scripts/package-platform.ts +183 -0
- package/scripts/set-platform-version.ts +62 -0
- package/scripts/setup-vs-toolchain.ps1 +152 -0
- package/scripts/verify-platform-package.ts +182 -0
- package/src/binder/references.ts +13 -1
- package/src/cli/main.ts +5 -1
- package/src/codegen/generator/module.ts +50 -0
- package/src/codegen/generator/statements/variables.ts +6 -3
- package/src/driver/runtime-lib.ts +73 -9
- package/src/driver/version.ts +1 -1
- package/src/extensions/gui/css.ts +113 -0
- package/src/extensions/gui/html.ts +9 -2
- package/src/extensions/gui/index.ts +22 -7
- package/src/extensions/gui/three.ts +25 -0
- package/src/extensions/media/index.ts +16 -18
- package/src/parser/context.ts +99 -4
- package/src/parser/literals.ts +6 -12
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* xbintsc GUI engine — background layer painting.
|
|
3
|
+
*
|
|
4
|
+
* The renderer has one rounded-rectangle pipeline and no gradient shader, so a
|
|
5
|
+
* gradient is emitted as a run of solid bands: 18 strips for a linear gradient
|
|
6
|
+
* and 32 concentric ellipses for a radial one. Radial ellipses use the shape
|
|
7
|
+
* pipeline's transform slot (a unit circle scaled to the ellipse radii), which
|
|
8
|
+
* keeps the distance-field antialiasing intact.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "paint_internal.h"
|
|
12
|
+
|
|
13
|
+
#include <algorithm>
|
|
14
|
+
#include <cmath>
|
|
15
|
+
#include <vector>
|
|
16
|
+
|
|
17
|
+
namespace xtgui {
|
|
18
|
+
namespace paint_detail {
|
|
19
|
+
|
|
20
|
+
namespace {
|
|
21
|
+
|
|
22
|
+
Color gradientColorAt(const BackgroundLayer &layer, float t) {
|
|
23
|
+
const std::vector<BackgroundGradientStop> &stops = layer.stops;
|
|
24
|
+
if (stops.empty()) return Color();
|
|
25
|
+
if (t <= stops.front().offset) return stops.front().color;
|
|
26
|
+
if (t >= stops.back().offset) return stops.back().color;
|
|
27
|
+
for (size_t i = 1; i < stops.size(); i++) {
|
|
28
|
+
if (t > stops[i].offset) continue;
|
|
29
|
+
float span = stops[i].offset - stops[i - 1].offset;
|
|
30
|
+
float u = span > 0.00001f ? (t - stops[i - 1].offset) / span : 0.0f;
|
|
31
|
+
Color a = stops[i - 1].color;
|
|
32
|
+
Color b = stops[i].color;
|
|
33
|
+
Color out;
|
|
34
|
+
out.r = a.r + (b.r - a.r) * u;
|
|
35
|
+
out.g = a.g + (b.g - a.g) * u;
|
|
36
|
+
out.b = a.b + (b.b - a.b) * u;
|
|
37
|
+
out.a = a.a + (b.a - a.a) * u;
|
|
38
|
+
out.valid = true;
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
return stops.back().color;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Intersect `clip` with the box's border box (backgrounds never paint outside
|
|
45
|
+
* it, even when the box is not an overflow container). */
|
|
46
|
+
PaintClip boxClip(const PaintClip &clip, const LayoutBox &box) {
|
|
47
|
+
float bx = box.x;
|
|
48
|
+
float by = box.y;
|
|
49
|
+
float bw = box.width;
|
|
50
|
+
float bh = box.height;
|
|
51
|
+
if (box.has_transform) {
|
|
52
|
+
LayoutRect bounds = xt_layout_transform_rect(box.world, bx, by, bw, bh);
|
|
53
|
+
bx = bounds.x;
|
|
54
|
+
by = bounds.y;
|
|
55
|
+
bw = bounds.width;
|
|
56
|
+
bh = bounds.height;
|
|
57
|
+
}
|
|
58
|
+
PaintClip out = clip;
|
|
59
|
+
if (!out.active) {
|
|
60
|
+
out.active = true;
|
|
61
|
+
out.x = bx;
|
|
62
|
+
out.y = by;
|
|
63
|
+
out.width = bw;
|
|
64
|
+
out.height = bh;
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
float x0 = std::max(out.x, bx);
|
|
68
|
+
float y0 = std::max(out.y, by);
|
|
69
|
+
float x1 = std::min(out.x + out.width, bx + bw);
|
|
70
|
+
float y1 = std::min(out.y + out.height, by + bh);
|
|
71
|
+
out.x = x0;
|
|
72
|
+
out.y = y0;
|
|
73
|
+
out.width = std::max(0.0f, x1 - x0);
|
|
74
|
+
out.height = std::max(0.0f, y1 - y0);
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
void paintLinear(const LayoutBox &box, const BackgroundLayer &layer, const FilterChain &chain,
|
|
79
|
+
const PaintClip &clip, DisplayList &out) {
|
|
80
|
+
if (layer.stops.size() < 2 || box.width <= 0.0f || box.height <= 0.0f) return;
|
|
81
|
+
const int strips = 18;
|
|
82
|
+
bool horizontal = (layer.angle > 80.0f && layer.angle < 100.0f) ||
|
|
83
|
+
(layer.angle > 260.0f && layer.angle < 280.0f);
|
|
84
|
+
bool reverse = (layer.angle > 260.0f && layer.angle < 280.0f) || layer.angle < 10.0f ||
|
|
85
|
+
layer.angle > 350.0f;
|
|
86
|
+
for (int i = 0; i < strips; i++) {
|
|
87
|
+
float t = ((float)i + 0.5f) / (float)strips;
|
|
88
|
+
Color color = gradientColorAt(layer, reverse ? 1.0f - t : t);
|
|
89
|
+
color = filterColor(chain, color);
|
|
90
|
+
if (color.a <= 0.0f) continue;
|
|
91
|
+
if (horizontal) {
|
|
92
|
+
addRect(out, box.x + box.width * (float)i / (float)strips, box.y,
|
|
93
|
+
box.width / (float)strips + 0.4f, box.height, 0.0f, color, clip, box.world);
|
|
94
|
+
} else {
|
|
95
|
+
addRect(out, box.x, box.y + box.height * (float)i / (float)strips, box.width,
|
|
96
|
+
box.height / (float)strips + 0.4f, 0.0f, color, clip, box.world);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Default radii for `closest-side` / `farthest-side` / corner keywords. */
|
|
102
|
+
void radialRadii(const LayoutBox &box, const BackgroundLayer &layer, const XtStyle &style,
|
|
103
|
+
float viewportWidth, float viewportHeight, float *cx, float *cy, float *rx,
|
|
104
|
+
float *ry) {
|
|
105
|
+
float centerX = box.x + resolveLength(layer.center_x, box.width, style.font_size, viewportWidth,
|
|
106
|
+
viewportHeight);
|
|
107
|
+
float centerY = box.y + resolveLength(layer.center_y, box.height, style.font_size, viewportWidth,
|
|
108
|
+
viewportHeight);
|
|
109
|
+
float left = centerX - box.x;
|
|
110
|
+
float right = box.x + box.width - centerX;
|
|
111
|
+
float top = centerY - box.y;
|
|
112
|
+
float bottom = box.y + box.height - centerY;
|
|
113
|
+
left = std::max(0.0f, left);
|
|
114
|
+
right = std::max(0.0f, right);
|
|
115
|
+
top = std::max(0.0f, top);
|
|
116
|
+
bottom = std::max(0.0f, bottom);
|
|
117
|
+
|
|
118
|
+
if (layer.size == RadialSize::Explicit) {
|
|
119
|
+
float radiusX =
|
|
120
|
+
resolveLength(layer.radius_x, box.width, style.font_size, viewportWidth, viewportHeight);
|
|
121
|
+
float radiusY = layer.circle
|
|
122
|
+
? radiusX
|
|
123
|
+
: resolveLength(layer.radius_y, box.height, style.font_size, viewportWidth,
|
|
124
|
+
viewportHeight);
|
|
125
|
+
*cx = centerX;
|
|
126
|
+
*cy = centerY;
|
|
127
|
+
*rx = std::max(0.0f, radiusX);
|
|
128
|
+
*ry = std::max(0.0f, radiusY);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (layer.circle) {
|
|
133
|
+
float radius = 0.0f;
|
|
134
|
+
switch (layer.size) {
|
|
135
|
+
case RadialSize::ClosestSide:
|
|
136
|
+
radius = std::min(std::min(left, right), std::min(top, bottom));
|
|
137
|
+
break;
|
|
138
|
+
case RadialSize::FarthestSide:
|
|
139
|
+
radius = std::max(std::max(left, right), std::max(top, bottom));
|
|
140
|
+
break;
|
|
141
|
+
case RadialSize::ClosestCorner:
|
|
142
|
+
radius = std::sqrt(std::min(left, right) * std::min(left, right) +
|
|
143
|
+
std::min(top, bottom) * std::min(top, bottom));
|
|
144
|
+
break;
|
|
145
|
+
case RadialSize::FarthestCorner:
|
|
146
|
+
default:
|
|
147
|
+
radius = std::sqrt(std::max(left, right) * std::max(left, right) +
|
|
148
|
+
std::max(top, bottom) * std::max(top, bottom));
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
*rx = *ry = radius;
|
|
152
|
+
} else {
|
|
153
|
+
switch (layer.size) {
|
|
154
|
+
case RadialSize::ClosestCorner:
|
|
155
|
+
case RadialSize::ClosestSide:
|
|
156
|
+
*rx = std::min(left, right);
|
|
157
|
+
*ry = std::min(top, bottom);
|
|
158
|
+
break;
|
|
159
|
+
case RadialSize::FarthestSide:
|
|
160
|
+
case RadialSize::FarthestCorner:
|
|
161
|
+
default:
|
|
162
|
+
*rx = std::max(left, right);
|
|
163
|
+
*ry = std::max(top, bottom);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
*cx = centerX;
|
|
168
|
+
*cy = centerY;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** One filled ellipse: a unit-radius rounded rect mapped by a local scale. */
|
|
172
|
+
void addEllipse(DisplayList &out, float cx, float cy, float rx, float ry, const Color &color,
|
|
173
|
+
const PaintClip &clip, const Matrix2D &world) {
|
|
174
|
+
if (rx <= 0.0f || ry <= 0.0f || color.a <= 0.0f) return;
|
|
175
|
+
Matrix2D local = Matrix2D::translate(cx, cy)
|
|
176
|
+
.multiply(Matrix2D::scale(rx, ry))
|
|
177
|
+
.multiply(Matrix2D::translate(-cx, -cy));
|
|
178
|
+
addRect(out, cx - 1.0f, cy - 1.0f, 2.0f, 2.0f, 1.0f, color, clip, world.multiply(local));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
void paintRadial(const LayoutBox &box, const XtStyle &style, const BackgroundLayer &layer,
|
|
182
|
+
const FilterChain &chain, const PaintClip &clip, float viewportWidth,
|
|
183
|
+
float viewportHeight, DisplayList &out) {
|
|
184
|
+
if (layer.stops.size() < 2 || box.width <= 0.0f || box.height <= 0.0f) return;
|
|
185
|
+
float cx = 0.0f;
|
|
186
|
+
float cy = 0.0f;
|
|
187
|
+
float rx = 0.0f;
|
|
188
|
+
float ry = 0.0f;
|
|
189
|
+
radialRadii(box, layer, style, viewportWidth, viewportHeight, &cx, &cy, &rx, &ry);
|
|
190
|
+
if (rx <= 0.0f || ry <= 0.0f) return;
|
|
191
|
+
const int bands = 32;
|
|
192
|
+
for (int i = bands; i >= 1; i--) {
|
|
193
|
+
float t = (float)i / (float)bands;
|
|
194
|
+
Color color = filterColor(chain, gradientColorAt(layer, t));
|
|
195
|
+
if (color.a <= 0.0f) continue;
|
|
196
|
+
addEllipse(out, cx, cy, rx * t, ry * t, color, clip, box.world);
|
|
197
|
+
}
|
|
198
|
+
/* Exact centre colour (the innermost band samples just off zero). */
|
|
199
|
+
Color center = filterColor(chain, gradientColorAt(layer, 0.0f));
|
|
200
|
+
addEllipse(out, cx, cy, 0.6f, 0.6f, center, clip, box.world);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
} // namespace
|
|
204
|
+
|
|
205
|
+
void paintBackgrounds(DisplayList &out, const LayoutBox &box, const XtStyle &style,
|
|
206
|
+
const FilterChain &chain, const PaintClip &clip, float viewportWidth,
|
|
207
|
+
float viewportHeight) {
|
|
208
|
+
PaintClip layerClip = boxClip(clip, box);
|
|
209
|
+
if (layerClip.width <= 0.0f || layerClip.height <= 0.0f) return;
|
|
210
|
+
if (style.has_background) {
|
|
211
|
+
/* The rectangle is already the border box, so the incoming clip is enough;
|
|
212
|
+
* narrowing it to the box again would only change the reported clip (and
|
|
213
|
+
* would clip a filtered/rounded fill differently from before M19). */
|
|
214
|
+
addRectFiltered(out, box.x, box.y, box.width, box.height, style.border_radius,
|
|
215
|
+
style.background, clip, box.world, chain);
|
|
216
|
+
}
|
|
217
|
+
/* CSS paints the first layer on top, so walk the list backwards. */
|
|
218
|
+
for (size_t i = style.background_layers.size(); i-- > 0;) {
|
|
219
|
+
const BackgroundLayer &layer = style.background_layers[i];
|
|
220
|
+
if (layer.kind == BackgroundKind::Linear) {
|
|
221
|
+
paintLinear(box, layer, chain, layerClip, out);
|
|
222
|
+
} else {
|
|
223
|
+
paintRadial(box, style, layer, chain, layerClip, viewportWidth, viewportHeight, out);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
} // namespace paint_detail
|
|
229
|
+
} // namespace xtgui
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* xbintsc GUI engine — `clip-path` geometry.
|
|
3
|
+
*
|
|
4
|
+
* CSS shapes become one device-space polygon, which is triangulated with ear
|
|
5
|
+
* clipping (so concave `polygon()` shapes work). The renderer intersects every
|
|
6
|
+
* convex shape/text/image quad with those triangles; no stencil or shader
|
|
7
|
+
* change is needed.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "paint_internal.h"
|
|
11
|
+
|
|
12
|
+
#include <algorithm>
|
|
13
|
+
#include <cmath>
|
|
14
|
+
#include <vector>
|
|
15
|
+
|
|
16
|
+
namespace xtgui {
|
|
17
|
+
namespace paint_detail {
|
|
18
|
+
|
|
19
|
+
namespace {
|
|
20
|
+
|
|
21
|
+
constexpr float kPi = 3.14159265358979323846f;
|
|
22
|
+
|
|
23
|
+
struct Point {
|
|
24
|
+
float x = 0.0f;
|
|
25
|
+
float y = 0.0f;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
float resolveX(const Length &length, float base, float em, float vw, float vh) {
|
|
29
|
+
return resolveLength(length, base, em, vw, vh);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
float resolveY(const Length &length, float base, float em, float vw, float vh) {
|
|
33
|
+
return resolveLength(length, base, em, vw, vh);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
void appendPoint(std::vector<Point> *points, const Point &point) {
|
|
37
|
+
if (!points->empty()) {
|
|
38
|
+
const Point &last = points->back();
|
|
39
|
+
if (std::fabs(last.x - point.x) < 0.0001f && std::fabs(last.y - point.y) < 0.0001f) return;
|
|
40
|
+
}
|
|
41
|
+
points->push_back(point);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Rounded-rectangle outline (used by `inset(... round r)`). */
|
|
45
|
+
void insetOutline(const LayoutBox &box, const XtStyle &style, const ClipPathSpec &clip, float vw,
|
|
46
|
+
float vh, std::vector<Point> *points) {
|
|
47
|
+
float em = style.font_size;
|
|
48
|
+
float top = resolveY(clip.inset_top, box.height, em, vw, vh);
|
|
49
|
+
float right = resolveX(clip.inset_right, box.width, em, vw, vh);
|
|
50
|
+
float bottom = resolveY(clip.inset_bottom, box.height, em, vw, vh);
|
|
51
|
+
float left = resolveX(clip.inset_left, box.width, em, vw, vh);
|
|
52
|
+
float x0 = box.x + left;
|
|
53
|
+
float y0 = box.y + top;
|
|
54
|
+
float x1 = box.x + box.width - right;
|
|
55
|
+
float y1 = box.y + box.height - bottom;
|
|
56
|
+
if (x1 < x0) std::swap(x0, x1);
|
|
57
|
+
if (y1 < y0) std::swap(y0, y1);
|
|
58
|
+
if (x1 - x0 <= 0.0f || y1 - y0 <= 0.0f) return;
|
|
59
|
+
float radius = resolveLength(clip.inset_radius, std::min(x1 - x0, y1 - y0), em, vw, vh);
|
|
60
|
+
radius = std::max(0.0f, std::min(radius, std::min(x1 - x0, y1 - y0) * 0.5f));
|
|
61
|
+
if (radius <= 0.0f) {
|
|
62
|
+
appendPoint(points, {x0, y0});
|
|
63
|
+
appendPoint(points, {x1, y0});
|
|
64
|
+
appendPoint(points, {x1, y1});
|
|
65
|
+
appendPoint(points, {x0, y1});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const int segments = 6;
|
|
69
|
+
/* Clockwise from the top-left corner's start, one quarter arc per corner. */
|
|
70
|
+
for (int i = 0; i <= segments; i++) {
|
|
71
|
+
float angle = kPi + (float)i / (float)segments * (kPi * 0.5f);
|
|
72
|
+
appendPoint(points, {x0 + radius + std::cos(angle) * radius,
|
|
73
|
+
y0 + radius + std::sin(angle) * radius});
|
|
74
|
+
}
|
|
75
|
+
for (int i = 0; i <= segments; i++) {
|
|
76
|
+
float angle = kPi * 1.5f + (float)i / (float)segments * (kPi * 0.5f);
|
|
77
|
+
appendPoint(points, {x1 - radius + std::cos(angle) * radius,
|
|
78
|
+
y0 + radius + std::sin(angle) * radius});
|
|
79
|
+
}
|
|
80
|
+
for (int i = 0; i <= segments; i++) {
|
|
81
|
+
float angle = (float)i / (float)segments * (kPi * 0.5f);
|
|
82
|
+
appendPoint(points, {x1 - radius + std::cos(angle) * radius,
|
|
83
|
+
y1 - radius + std::sin(angle) * radius});
|
|
84
|
+
}
|
|
85
|
+
for (int i = 0; i <= segments; i++) {
|
|
86
|
+
float angle = kPi * 0.5f + (float)i / (float)segments * (kPi * 0.5f);
|
|
87
|
+
appendPoint(points, {x0 + radius + std::cos(angle) * radius,
|
|
88
|
+
y1 - radius + std::sin(angle) * radius});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
void ellipseOutline(const LayoutBox &box, const XtStyle &style, const ClipPathSpec &clip, float vw,
|
|
93
|
+
float vh, std::vector<Point> *points) {
|
|
94
|
+
float em = style.font_size;
|
|
95
|
+
float cx = box.x + resolveX(clip.center_x, box.width, em, vw, vh);
|
|
96
|
+
float cy = box.y + resolveY(clip.center_y, box.height, em, vw, vh);
|
|
97
|
+
bool circle = clip.type == ClipPathSpec::Type::Circle;
|
|
98
|
+
float rx = 0.0f;
|
|
99
|
+
float ry = 0.0f;
|
|
100
|
+
if (clip.radius_explicit) {
|
|
101
|
+
if (circle && clip.radius_x.unit == Unit::Percent) {
|
|
102
|
+
/* CSS resolves a circle percentage against sqrt(w² + h²) / sqrt(2). */
|
|
103
|
+
float diagonal = std::sqrt(box.width * box.width + box.height * box.height);
|
|
104
|
+
rx = ry = diagonal / std::sqrt(2.0f) * clip.radius_x.value / 100.0f;
|
|
105
|
+
} else {
|
|
106
|
+
rx = resolveX(clip.radius_x, box.width, em, vw, vh);
|
|
107
|
+
ry = circle ? rx : resolveY(clip.radius_y, box.height, em, vw, vh);
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
float left = std::max(0.0f, cx - box.x);
|
|
111
|
+
float right = std::max(0.0f, box.x + box.width - cx);
|
|
112
|
+
float top = std::max(0.0f, cy - box.y);
|
|
113
|
+
float bottom = std::max(0.0f, box.y + box.height - cy);
|
|
114
|
+
if (circle) {
|
|
115
|
+
rx = ry = std::min(std::min(left, right), std::min(top, bottom));
|
|
116
|
+
} else {
|
|
117
|
+
rx = std::min(left, right);
|
|
118
|
+
ry = std::min(top, bottom);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (rx <= 0.0f || ry <= 0.0f) return;
|
|
122
|
+
const int segments = 48;
|
|
123
|
+
for (int i = 0; i < segments; i++) {
|
|
124
|
+
float angle = (float)i / (float)segments * kPi * 2.0f;
|
|
125
|
+
appendPoint(points, {cx + std::cos(angle) * rx, cy + std::sin(angle) * ry});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
void polygonOutline(const LayoutBox &box, const XtStyle &style, const ClipPathSpec &clip, float vw,
|
|
130
|
+
float vh, std::vector<Point> *points) {
|
|
131
|
+
float em = style.font_size;
|
|
132
|
+
for (size_t i = 0; i + 1 < clip.polygon.size(); i += 2) {
|
|
133
|
+
float x = box.x + resolveX(clip.polygon[i], box.width, em, vw, vh);
|
|
134
|
+
float y = box.y + resolveY(clip.polygon[i + 1], box.height, em, vw, vh);
|
|
135
|
+
appendPoint(points, {x, y});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
float cross(const Point &a, const Point &b, const Point &c) {
|
|
140
|
+
return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
bool pointInTriangle(const Point &p, const Point &a, const Point &b, const Point &c) {
|
|
144
|
+
float c1 = cross(a, b, p);
|
|
145
|
+
float c2 = cross(b, c, p);
|
|
146
|
+
float c3 = cross(c, a, p);
|
|
147
|
+
const float eps = 0.0001f;
|
|
148
|
+
bool hasNeg = c1 < -eps || c2 < -eps || c3 < -eps;
|
|
149
|
+
bool hasPos = c1 > eps || c2 > eps || c3 > eps;
|
|
150
|
+
return !(hasNeg && hasPos);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Ear clipping for a simple polygon; falls back to a fan if it stalls. */
|
|
154
|
+
void triangulate(std::vector<Point> points, std::vector<ClipTriangle> *triangles) {
|
|
155
|
+
if (points.size() < 3) return;
|
|
156
|
+
/* Remove a repeated closing point. */
|
|
157
|
+
if (std::fabs(points.front().x - points.back().x) < 0.0001f &&
|
|
158
|
+
std::fabs(points.front().y - points.back().y) < 0.0001f)
|
|
159
|
+
points.pop_back();
|
|
160
|
+
if (points.size() < 3) return;
|
|
161
|
+
float area = 0.0f;
|
|
162
|
+
for (size_t i = 0; i < points.size(); i++) {
|
|
163
|
+
const Point &a = points[i];
|
|
164
|
+
const Point &b = points[(i + 1) % points.size()];
|
|
165
|
+
area += a.x * b.y - b.x * a.y;
|
|
166
|
+
}
|
|
167
|
+
if (area < 0.0f) std::reverse(points.begin(), points.end());
|
|
168
|
+
std::vector<size_t> indices(points.size());
|
|
169
|
+
for (size_t i = 0; i < indices.size(); i++) indices[i] = i;
|
|
170
|
+
size_t guard = 0;
|
|
171
|
+
while (indices.size() > 3 && guard++ < indices.size() * indices.size() + 8) {
|
|
172
|
+
bool clipped = false;
|
|
173
|
+
for (size_t i = 0; i < indices.size(); i++) {
|
|
174
|
+
size_t previous = indices[(i + indices.size() - 1) % indices.size()];
|
|
175
|
+
size_t current = indices[i];
|
|
176
|
+
size_t next = indices[(i + 1) % indices.size()];
|
|
177
|
+
const Point &a = points[previous];
|
|
178
|
+
const Point &b = points[current];
|
|
179
|
+
const Point &c = points[next];
|
|
180
|
+
if (cross(a, b, c) <= 0.0001f) continue;
|
|
181
|
+
bool contains = false;
|
|
182
|
+
for (size_t other : indices) {
|
|
183
|
+
if (other == previous || other == current || other == next) continue;
|
|
184
|
+
if (pointInTriangle(points[other], a, b, c)) {
|
|
185
|
+
contains = true;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (contains) continue;
|
|
190
|
+
ClipTriangle triangle;
|
|
191
|
+
triangle.x[0] = a.x;
|
|
192
|
+
triangle.y[0] = a.y;
|
|
193
|
+
triangle.x[1] = b.x;
|
|
194
|
+
triangle.y[1] = b.y;
|
|
195
|
+
triangle.x[2] = c.x;
|
|
196
|
+
triangle.y[2] = c.y;
|
|
197
|
+
triangles->push_back(triangle);
|
|
198
|
+
indices.erase(indices.begin() + (long)i);
|
|
199
|
+
clipped = true;
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
if (!clipped) break;
|
|
203
|
+
}
|
|
204
|
+
if (indices.size() >= 3) {
|
|
205
|
+
for (size_t i = 1; i + 1 < indices.size(); i++) {
|
|
206
|
+
ClipTriangle triangle;
|
|
207
|
+
triangle.x[0] = points[indices[0]].x;
|
|
208
|
+
triangle.y[0] = points[indices[0]].y;
|
|
209
|
+
triangle.x[1] = points[indices[i]].x;
|
|
210
|
+
triangle.y[1] = points[indices[i]].y;
|
|
211
|
+
triangle.x[2] = points[indices[i + 1]].x;
|
|
212
|
+
triangle.y[2] = points[indices[i + 1]].y;
|
|
213
|
+
triangles->push_back(triangle);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
} // namespace
|
|
219
|
+
|
|
220
|
+
int addClipPathForBox(DisplayList &out, const LayoutBox &box, const XtStyle &style,
|
|
221
|
+
float viewportWidth, float viewportHeight) {
|
|
222
|
+
if (style.clip_path.type == ClipPathSpec::Type::None) return -1;
|
|
223
|
+
std::vector<Point> points;
|
|
224
|
+
switch (style.clip_path.type) {
|
|
225
|
+
case ClipPathSpec::Type::Inset:
|
|
226
|
+
insetOutline(box, style, style.clip_path, viewportWidth, viewportHeight, &points);
|
|
227
|
+
break;
|
|
228
|
+
case ClipPathSpec::Type::Circle:
|
|
229
|
+
case ClipPathSpec::Type::Ellipse:
|
|
230
|
+
ellipseOutline(box, style, style.clip_path, viewportWidth, viewportHeight, &points);
|
|
231
|
+
break;
|
|
232
|
+
case ClipPathSpec::Type::Polygon:
|
|
233
|
+
polygonOutline(box, style, style.clip_path, viewportWidth, viewportHeight, &points);
|
|
234
|
+
break;
|
|
235
|
+
default:
|
|
236
|
+
return -1;
|
|
237
|
+
}
|
|
238
|
+
/* An empty but valid shape (`inset(50%)`, `circle(0)`) clips everything away;
|
|
239
|
+
* it must not fall back to "no clip". The paint walk keeps the empty geometry
|
|
240
|
+
* and the renderer emits no geometry for ops that reference it. */
|
|
241
|
+
ClipPathGeometry geometry;
|
|
242
|
+
geometry.points.reserve(points.size() * 2);
|
|
243
|
+
for (Point &point : points) {
|
|
244
|
+
float x = point.x;
|
|
245
|
+
float y = point.y;
|
|
246
|
+
box.world.apply(point.x, point.y, &x, &y);
|
|
247
|
+
geometry.points.push_back(x);
|
|
248
|
+
geometry.points.push_back(y);
|
|
249
|
+
}
|
|
250
|
+
if (points.size() >= 3) {
|
|
251
|
+
std::vector<Point> device;
|
|
252
|
+
device.reserve(points.size());
|
|
253
|
+
for (size_t i = 0; i + 1 < geometry.points.size(); i += 2)
|
|
254
|
+
device.push_back({geometry.points[i], geometry.points[i + 1]});
|
|
255
|
+
triangulate(device, &geometry.triangles);
|
|
256
|
+
}
|
|
257
|
+
out.clip_paths.push_back(std::move(geometry));
|
|
258
|
+
return (int)(out.clip_paths.size() - 1);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
PaintClip addClipPath(PaintClip clip, int index) {
|
|
262
|
+
if (index < 0) return clip;
|
|
263
|
+
if (clip.path_count < 2) clip.paths[clip.path_count++] = index;
|
|
264
|
+
return clip;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
} // namespace paint_detail
|
|
268
|
+
} // namespace xtgui
|