| 283 | } |
| 284 | |
| 285 | void PiuImage_set_frameIndex(xsMachine *the) |
| 286 | { |
| 287 | PiuImage* self = PIU(Image, xsThis); |
| 288 | xsIntegerValue frameCount = (*self)->frameCount; |
| 289 | if (frameCount > 1) { |
| 290 | xsIntegerValue frameIndex = xsToInteger(xsArg(0)); |
| 291 | if (frameIndex < 0) |
| 292 | frameIndex = 0; |
| 293 | else if (frameIndex >= frameCount) |
| 294 | frameIndex = frameCount - 1; |
| 295 | PiuContentSetTime((PiuContent*)self, ((double)frameIndex * PiuContentUseIdle(self)->duration) / (double)frameCount); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 |
nothing calls this directly
no test coverage detected