QmlProfiler: Constrain the length of painted events to the visible area

When overpainting, some note markers won't be visible.

Change-Id: I7888d43e8b1e3503b7a90e773e9c8138b70070f0
Task-number: QTCREATORBUG-13534
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>