forked from external/yambar
particle: all particles now take margin arguments
Ramp and map however, doesn't allow any values other than 0 (yet).
This commit is contained in:
parent
bd251cbf9f
commit
3135f1d36d
5 changed files with 56 additions and 52 deletions
|
@ -58,9 +58,14 @@ particle_destroy(struct particle *particle)
|
|||
|
||||
struct particle *
|
||||
particle_map_new(const char *tag, const struct particle_map *particle_map,
|
||||
size_t count, struct particle *default_particle)
|
||||
size_t count, struct particle *default_particle,
|
||||
int left_margin, int right_margin)
|
||||
{
|
||||
struct particle *particle = particle_common_new(0, 0, NULL);
|
||||
assert(left_margin == 0 && right_margin == 0
|
||||
&& "map: margins not implemented");
|
||||
|
||||
struct particle *particle = particle_common_new(
|
||||
left_margin, right_margin, NULL);
|
||||
particle->destroy = &particle_destroy;
|
||||
particle->instantiate = &instantiate;
|
||||
|
||||
|
|
|
@ -8,4 +8,4 @@ struct particle_map {
|
|||
|
||||
struct particle *particle_map_new(
|
||||
const char *tag, const struct particle_map *particle_map, size_t count,
|
||||
struct particle *default_particle);
|
||||
struct particle *default_particle, int left_margin, int right_margin);
|
||||
|
|
|
@ -59,9 +59,14 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
|
|||
}
|
||||
|
||||
struct particle *
|
||||
particle_ramp_new(const char *tag, struct particle *particles[], size_t count)
|
||||
particle_ramp_new(const char *tag, struct particle *particles[], size_t count,
|
||||
int left_margin, int right_margin)
|
||||
{
|
||||
struct particle *particle = particle_common_new(0, 0, NULL);
|
||||
assert(left_margin == 0 && right_margin == 0
|
||||
&& "ramp: margins not implemented");
|
||||
|
||||
struct particle *particle = particle_common_new(
|
||||
left_margin, right_margin, NULL);
|
||||
particle->destroy = &particle_destroy;
|
||||
particle->instantiate = &instantiate;
|
||||
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
#include "../particle.h"
|
||||
|
||||
struct particle *particle_ramp_new(
|
||||
const char *tag, struct particle *particles[], size_t count);
|
||||
const char *tag, struct particle *particles[], size_t count,
|
||||
int left_margin, int right_margin);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue