was rewritten function for drawing CCD rectangle; fix flipping in CCD view