diff options
Diffstat (limited to 'rotord/src/nodes_drawing.h')
| -rw-r--r-- | rotord/src/nodes_drawing.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h index 7e7a178..f428fd8 100644 --- a/rotord/src/nodes_drawing.h +++ b/rotord/src/nodes_drawing.h @@ -215,19 +215,16 @@ namespace Rotor { ~Mosaic(){}; Mosaic* clone(map<string,string> &_settings) { return new Mosaic(_settings);}; void vector_output(cairo_t * cr,const Frame_spec &frame){ - double vpix=max(parameters["pixels"]->value,1.0); + double vpix=min((double)frame.h,max(parameters["pixels"]->value,1.0)); double pixel_size=frame.h/vpix; int h_padded=ceil(vpix/2)*2; int w_padded=ceil((((vpix/frame.h)*frame.w))/2)*2; - Image *in1=image_inputs[0]->get(frame); if (in1){ Image in=*(in1); in.crop(w_padded*pixel_size,h_padded*pixel_size); in.resize(w_padded,h_padded); - int x_start=-((w_padded*pixel_size)/2); - int y_start=-((h_padded*pixel_size)/2); - cairo_translate(cr,x_start,y_start); + cairo_translate(cr,-((w_padded*pixel_size)/2),-((h_padded*pixel_size)/2)); for (int i=0;i<w_padded;i++){ for (int j=0;j<h_padded;j++){ double R=((double)in.rgb.data[3*(w_padded*j + i) + 0])/255.0; |
