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
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2012-11-12 14:38:51 +0400
committerJoshua Leung <aligorith@gmail.com>2012-11-12 14:38:51 +0400
commit0fc0cb351b5e838dce7a14e8fe68fb6f7125eab0 (patch)
tree28395767bc789c1c26439e7a397701aa164f5252 /source/blender/editors/gpencil
parent40382c15ac20b2d3e7ade2c1be9600160b63f5b3 (diff)
More spelling errors, whitespace, and simplifying code with many side effects
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c23
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
2 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 835f5dfa87a..e9ca7392752 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -139,11 +139,11 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
return &sseq->gpd;
}
break;
-
+
case SPACE_IMAGE: /* Image/UV Editor */
{
SpaceImage *sima = (SpaceImage *)CTX_wm_space_data(C);
-
+
/* for now, Grease Pencil data is associated with the space... */
/* XXX our convention for everything else is to link to data though... */
if (ptr) RNA_pointer_create(screen_id, &RNA_SpaceImageEditor, sima, ptr);
@@ -159,19 +159,19 @@ bGPdata **gpencil_data_get_pointers(const bContext *C, PointerRNA *ptr)
if (clip) {
if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
MovieTrackingTrack *track = BKE_tracking_track_get_active(&clip->tracking);
-
+
if (!track)
return NULL;
-
+
if (ptr)
RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, ptr);
-
+
return &track->gpd;
}
else {
if (ptr)
RNA_id_pointer_create(&clip->id, ptr);
-
+
return &clip->gpd;
}
}
@@ -535,15 +535,19 @@ static void gp_timing_data_add_point(tGpTimingData *gtd, double stroke_inittime,
{
if (time < 0.0f) {
/* This is a gap, negative value! */
- gtd->tot_time = -(gtd->times[gtd->cur_point] = -(((float)(stroke_inittime - gtd->inittime)) + time));
+ gtd->times[gtd->cur_point] = -(((float)(stroke_inittime - gtd->inittime)) + time);
+ gtd->tot_time = -gtd->times[gtd->cur_point];
+
gtd->gap_tot_time += gtd->times[gtd->cur_point] - gtd->times[gtd->cur_point - 1];
}
else {
- gtd->tot_time = (gtd->times[gtd->cur_point] = (((float)(stroke_inittime - gtd->inittime)) + time));
+ gtd->times[gtd->cur_point] = (((float)(stroke_inittime - gtd->inittime)) + time);
+ gtd->tot_time = (gtd->times[gtd->cur_point]);
}
gtd->tot_dist += delta_dist;
gtd->dists[gtd->cur_point] = gtd->tot_dist;
+
gtd->cur_point++;
}
@@ -569,13 +573,14 @@ static int gp_find_end_of_stroke_idx(tGpTimingData *gtd, int idx, int nbr_gaps,
/* We want gaps that are in gtd->gap_duration +/- gtd->gap_randomness range,
* and which sum to exactly tot_gaps_time...
*/
- int rem_gaps = nbr_gaps - *nbr_done_gaps;
+ int rem_gaps = nbr_gaps - (*nbr_done_gaps);
if (rem_gaps < 2) {
/* Last gap, just give remaining time! */
*next_delta_time = tot_gaps_time;
}
else {
float delta, min, max;
+
/* This code ensures that if the first gaps have been shorter than average gap_duration,
* next gaps will tend to be longer (i.e. try to recover the lateness), and vice-versa!
*/
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index ad974e8b464..77f6d2bda5c 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -771,7 +771,7 @@ static short gp_stroke_eraser_splitdel(bGPDframe *gpf, bGPDstroke *gps, int i)
/* We must adjust timings!
* Each point's timing data is a delta from stroke's inittime, so as we erase the first
- * point of the stroke, we have to offset this inittime and all remaing points' delta values.
+ * point of the stroke, we have to offset this inittime and all remaining points' delta values.
* This way we get a new stroke with exactly the same timing as if user had started drawing from
* the second point...
*/