forked from bartvdbraak/blender
style cleanup
This commit is contained in:
parent
423ffa6043
commit
ac2fa65dd9
@ -262,9 +262,9 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
|
|||||||
glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
|
glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
|
||||||
|
|
||||||
/* only draw two separate 'curtains' if there's no overlap between them */
|
/* only draw two separate 'curtains' if there's no overlap between them */
|
||||||
if (PSFRA < PEFRA+end_frame_width) {
|
if (PSFRA < PEFRA + end_frame_width) {
|
||||||
glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
|
glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
|
||||||
glRectf((float)(PEFRA+end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
|
glRectf((float)(PEFRA + end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
|
glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
|
||||||
|
@ -389,17 +389,17 @@ static float paint_space_stroke_spacing_variable(const Scene *scene, PaintStroke
|
|||||||
* are aligned nicely with no overlap. for this the spacing needs to be
|
* are aligned nicely with no overlap. for this the spacing needs to be
|
||||||
* the average of the previous and next size. */
|
* the average of the previous and next size. */
|
||||||
float s = paint_space_stroke_spacing(scene, stroke, 1.0f, pressure);
|
float s = paint_space_stroke_spacing(scene, stroke, 1.0f, pressure);
|
||||||
float q = s*dpressure/(2.0f*length);
|
float q = s * dpressure / (2.0f * length);
|
||||||
float pressure_fac = (1.0f + q)/(1.0f - q);
|
float pressure_fac = (1.0f + q) / (1.0f - q);
|
||||||
|
|
||||||
float last_size_pressure = stroke->last_pressure;
|
float last_size_pressure = stroke->last_pressure;
|
||||||
float new_size_pressure = stroke->last_pressure*pressure_fac;
|
float new_size_pressure = stroke->last_pressure * pressure_fac;
|
||||||
|
|
||||||
/* average spacing */
|
/* average spacing */
|
||||||
float last_spacing = paint_space_stroke_spacing(scene, stroke, last_size_pressure, pressure);
|
float last_spacing = paint_space_stroke_spacing(scene, stroke, last_size_pressure, pressure);
|
||||||
float new_spacing = paint_space_stroke_spacing(scene, stroke, new_size_pressure, pressure);
|
float new_spacing = paint_space_stroke_spacing(scene, stroke, new_size_pressure, pressure);
|
||||||
|
|
||||||
return 0.5f*(last_spacing + new_spacing);
|
return 0.5f * (last_spacing + new_spacing);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* no size pressure */
|
/* no size pressure */
|
||||||
@ -432,9 +432,9 @@ static int paint_space_stroke(bContext *C, wmOperator *op, const float final_mou
|
|||||||
float spacing = paint_space_stroke_spacing_variable(scene, stroke, pressure, dpressure, length);
|
float spacing = paint_space_stroke_spacing_variable(scene, stroke, pressure, dpressure, length);
|
||||||
|
|
||||||
if (length >= spacing) {
|
if (length >= spacing) {
|
||||||
mouse[0] = stroke->last_mouse_position[0] + dmouse[0]*spacing;
|
mouse[0] = stroke->last_mouse_position[0] + dmouse[0] * spacing;
|
||||||
mouse[1] = stroke->last_mouse_position[1] + dmouse[1]*spacing;
|
mouse[1] = stroke->last_mouse_position[1] + dmouse[1] * spacing;
|
||||||
pressure = stroke->last_pressure + (spacing/length)*dpressure;
|
pressure = stroke->last_pressure + (spacing / length) * dpressure;
|
||||||
|
|
||||||
paint_brush_stroke_add_step(C, op, mouse, pressure);
|
paint_brush_stroke_add_step(C, op, mouse, pressure);
|
||||||
|
|
||||||
|
@ -1381,7 +1381,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d)
|
|||||||
* frame range used is preview range or scene range */
|
* frame range used is preview range or scene range */
|
||||||
UI_ThemeColorShadeAlpha(TH_BACK, -25, -100);
|
UI_ThemeColorShadeAlpha(TH_BACK, -25, -100);
|
||||||
|
|
||||||
if (PSFRA < PEFRA+1) {
|
if (PSFRA < PEFRA + 1) {
|
||||||
glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
|
glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
|
||||||
glRectf((float)(PEFRA + 1), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
|
glRectf((float)(PEFRA + 1), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user