Change-Id: I2e2a4361e0ce1fb1857e4f0be7e781c56ead438c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/47485
Reviewed-by: Hudson CI
*/
public int getAvailableWidth(int requestedOffset) {
int totalWidth = fSashForm.getBounds().width;
- int timeWidth = totalWidth - requestedOffset;
- return timeWidth;
+ return Math.min(totalWidth, Math.max(0, totalWidth - requestedOffset));
}
/**
* @since 1.0
*/
public int getAvailableWidth(int requestedOffset) {
- return fTimeAlignedComposite.getSize().x - requestedOffset;
+ int totalWidth = fTimeAlignedComposite.getSize().x;
+ return Math.min(totalWidth, Math.max(0, totalWidth - requestedOffset));
}
/**