Fix color change

This commit is contained in:
Adrien Vannson 2023-01-10 22:03:26 +01:00
parent 948c2df728
commit 818269836d
No known key found for this signature in database
GPG Key ID: FE2E66FD978C1A55

View File

@ -68,7 +68,15 @@ function list_polygons(request, center, ratio,/* ind,*/ cb, selectedRoom)
*/return [(z[1]-center[1])/25, (z[0]-center[0])/25];
//}
})
})).map((x) => {return <Polygon positions={x} key={k} color={selectedRoom === k ? 'red' : 'grey'} onClick={() => cb(k)}><Tooltip>{k}</Tooltip></Polygon>})];
})).map((x) => {
//return <Polygon positions={x} key={k} color={selectedRoom === k ? 'red' : 'grey'} onClick={() => cb(k)}><Tooltip>{k}</Tooltip></Polygon>
const color = selectedRoom === k ? 'red' : 'grey';
return <Polygon positions={x} key={k + color} color={color} onClick={() => cb(k)}>
<Tooltip>{k}</Tooltip>
</Polygon>
})];
// })).map((x) => {tarace = tarace+1; return <Polygon positions={x} key={k} pathOptions={{color: 'grey'}}><Tooltip permanent direction={tarace % 2 === 0 ? "bottom" : "top"}>{k}</Tooltip><Popup>Popup</Popup></Polygon>})];
}
return polygons;