Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2022-04-12 00:56:11 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2022-04-12 01:01:30 +0300
commit6f1ad5f5e77ca5b5c257db97798e9a2087c9defd (patch)
treef5d29d8a298b878c733535e1ab0ef55fac4aeeff /source
parent3c62e539af9ce3a1eebb5541dd5a2d70e77e6103 (diff)
Fix wrong key type for GSet in Grease Pencil same material selection
The type of the key was changed from string to integer in 66da2f537ae8, but the GSet was still being created for string keys. As long as the integers stay small enough, this even kind of works on little-endian systems, but of course it should use an integer hash instead.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index d962dcdfa10..c4fd34212c3 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -826,7 +826,7 @@ static bool gpencil_select_same_material(bContext *C)
bGPdata *gpd = ED_gpencil_data_get_active(C);
const bool is_curve_edit = (bool)GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd);
/* First, build set containing all the colors of selected strokes */
- GSet *selected_colors = BLI_gset_str_new("GP Selected Colors");
+ GSet *selected_colors = BLI_gset_int_new("GP Selected Colors");
bool changed = false;
@@ -835,7 +835,7 @@ static bool gpencil_select_same_material(bContext *C)
/* add instead of insert here, otherwise the uniqueness check gets skipped,
* and we get many duplicate entries...
*/
- BLI_gset_add(selected_colors, &gps->mat_nr);
+ BLI_gset_add(selected_colors, POINTER_FROM_INT(gps->mat_nr));
}
}
CTX_DATA_END;
@@ -843,7 +843,8 @@ static bool gpencil_select_same_material(bContext *C)
/* Second, select any visible stroke that uses these colors */
if (is_curve_edit) {
CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
- if (gps->editcurve != NULL && BLI_gset_haskey(selected_colors, &gps->mat_nr)) {
+ if (gps->editcurve != NULL &&
+ BLI_gset_haskey(selected_colors, POINTER_FROM_INT(gps->mat_nr))) {
bGPDcurve *gpc = gps->editcurve;
for (int i = 0; i < gpc->tot_curve_points; i++) {
bGPDcurve_point *gpc_pt = &gpc->curve_points[i];
@@ -861,7 +862,7 @@ static bool gpencil_select_same_material(bContext *C)
}
else {
CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
- if (BLI_gset_haskey(selected_colors, &gps->mat_nr)) {
+ if (BLI_gset_haskey(selected_colors, POINTER_FROM_INT(gps->mat_nr))) {
/* select this stroke */
bGPDspoint *pt;
int i;