MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / SetAdaptWindows

Method SetAdaptWindows

Src/FrmViewerOpenGL.cpp:188–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void CFrmViewerOpenGL::SetAdaptWindows(ADAPT_WINDOWS aw)
189{
190 m_AdaptWindows = aw;
191 if(!m_Desktop.isNull())
192 {
193 switch (m_AdaptWindows) {
194 case Original:
195 case OriginalCenter:
196 SetZoomFactor(1);
197 case Zoom:
198 ReSize(m_Desktop.width(), m_Desktop.height());
199 m_VertexData = { -1.0, 1.0, 0.0, 0.0,
200 1.0, 1.0, 1.0, 0.0,
201 1.0, -1.0, 1.0, 1.0,
202 -1.0, -1.0, 0.0, 1.0 };
203 InitVertor();
204 break;
205 case ZoomToWindow:
206 {
207 m_VertexData = { -1.0, 1.0, 0.0, 0.0,
208 1.0, 1.0, 1.0, 0.0,
209 1.0, -1.0, 1.0, 1.0,
210 -1.0, -1.0, 0.0, 1.0 };
211 InitVertor();
212 break;
213 }
214 case KeepAspectRationToWindow:
215 {
216 QRectF r = GetAspectRationRect();
217 m_VertexData = { -((float)r.width()/(float)width()), (float)r.height()/(float)height(), 0.0, 0.0,
218 (float)r.width()/(float)width(), (float)r.height()/(float)height(), 1.0, 0.0,
219 (float)r.width()/(float)width(), -((float)r.height()/(float)height()), 1.0, 1.0,
220 -((float)r.width()/(float)width()), -((float)r.height()/(float)height()), 0.0, 1.0 };
221 InitVertor();
222 break;
223 }
224 default:
225 break;
226 }
227 }
228 update();
229 //setFocus();
230}
231
232CFrmViewerOpenGL::ADAPT_WINDOWS CFrmViewerOpenGL::GetAdaptWindows()
233{

Callers 1

SaveMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected