- len = ((boot->firmware_time + u->ixt) * SCALE_X)
- + (10.0 * strlen(u->name));
- if (len > width)
- width = len;
-
- if (u->iet > u->ixt && u->iet <= boot->finish_time
- && u->aet == 0 && u->axt == 0)
- u->aet = u->axt = u->iet;
- if (u->aet < u->ixt || u->aet > boot->finish_time)
- u->aet = boot->finish_time;
- if (u->axt < u->aet || u->aet > boot->finish_time)
- u->axt = boot->finish_time;
- if (u->iet < u->axt || u->iet > boot->finish_time)
- u->iet = boot->finish_time;
+
+ /* If the text cannot fit on the left side then
+ * increase the svg width so it fits on the right.
+ * TODO: calculate the text width more accurately */
+ text_width = 8.0 * strlen(u->name);
+ text_start = (boot->firmware_time + u->activating) * SCALE_X;
+ if (text_width > text_start && text_width + text_start > width)
+ width = text_width + text_start;
+
+ if (u->deactivated > u->activating && u->deactivated <= boot->finish_time
+ && u->activated == 0 && u->deactivating == 0)
+ u->activated = u->deactivating = u->deactivated;
+ if (u->activated < u->activating || u->activated > boot->finish_time)
+ u->activated = boot->finish_time;
+ if (u->deactivating < u->activated || u->activated > boot->finish_time)
+ u->deactivating = boot->finish_time;
+ if (u->deactivated < u->deactivating || u->deactivated > boot->finish_time)
+ u->deactivated = boot->finish_time;