| Summary: | [Scrollable] getClientArea reports negative dimension | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Tim Buschtoens <tbuschto> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | tbuschto |
| Version: | 1.4 | ||
| Target Milestone: | 1.4 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Small mistake in the code. It should be :
Rectangle getPadding() {
return new Rectangle( 10, 10, 10, 10 );
}
Fixed in CVS HEAD |
Scrollable#getClientArea will report negative dimensions if the sum of border, padding and Scrollbar is larger than the actual outer dimension. Test: public void testClientAreaIsZero() { Display display = new Display(); Composite shell = new Shell( display, SWT.NONE ); Composite composite = new Composite( shell, SWT.BORDER ); composite.setSize( 0, 0 ); assertEquals( 2, composite.getBorderWidth() ); Rectangle expected = new Rectangle( 0, 0, 0, 0 ); assertEquals( expected, composite.getClientArea() ); composite = new Composite( shell, SWT.BORDER ) { int getVScrollBarWidth() { return 20; } int getHScrollBarHeight() { return 20; } Rectangle getPadding() { return new Rectangle( 0, 0, 10, 10 ); } }; composite.setSize( 25, 25 ); assertEquals( 2, composite.getBorderWidth() ); expected = new Rectangle( 10, 10, 0, 0 ); assertEquals( expected, composite.getClientArea() ); }