Fixed bug that color bar will use wrong width value when switch in tool bar.