fixed overlay displaying

Current overlay rendering code does not take into account borders of selector.
This PR fix displaying of right and bottom overlay parts.
Also make overlay parts rendering and sizing more accurate.