@@ -67,6 +67,8 @@ public bool Equals(CamSettings other)
67
67
protected CamSettings lastSettings ;
68
68
69
69
protected Vector2 quadOffset ;
70
+ public Vector2 QuadMin { get ; protected set ; }
71
+ public Vector2 QuadMax { get ; protected set ; }
70
72
71
73
public Material CameraMaterial
72
74
{
@@ -253,11 +255,7 @@ protected void SetupCamera()
253
255
}
254
256
255
257
// Find the settings to be used for drawing the GL quad
256
- Vector2 pixelSize = new Vector2 ( pixelRenderSize [ 0 ] , pixelRenderSize [ 1 ] ) * zoomLevel ;
257
- quadOffset = pixelSize - screenRenderSize ;
258
- quadOffset /= 2 ;
259
- quadOffset . x /= Screen . width ;
260
- quadOffset . y /= Screen . height ;
258
+ CalculateQuad ( screenRenderSize , pixelRenderSize ) ;
261
259
262
260
// Important to release current render texture
263
261
cam . targetTexture = null ;
@@ -315,12 +313,22 @@ protected int[] GetRenderTextureSize(Vector2 size, Vector2 aspect)
315
313
return new [ ] { width , height } ;
316
314
}
317
315
318
- public void GetQuadBounds ( out Vector2 min , out Vector2 max )
316
+ private void CalculateQuad ( Vector2 screenRenderSize , int [ ] pixelRenderSize )
319
317
{
320
- min = Vector2 . zero - quadOffset ;
321
- max = Vector2 . one + quadOffset ;
318
+ Vector2 pixelSize = new Vector2 ( pixelRenderSize [ 0 ] , pixelRenderSize [ 1 ] ) * zoomLevel ;
319
+ quadOffset = pixelSize - screenRenderSize ;
320
+ quadOffset /= 2 ;
321
+ quadOffset . x /= Screen . width ;
322
+ quadOffset . y /= Screen . height ;
323
+
324
+ Vector2 min = Vector2 . zero - quadOffset ;
325
+ Vector2 max = Vector2 . one + quadOffset ;
322
326
if ( advancedSettings == null )
327
+ {
328
+ QuadMin = min ;
329
+ QuadMax = max ;
323
330
return ;
331
+ }
324
332
325
333
Vector2 aspectStretch = advancedSettings . aspectStretch ;
326
334
if ( aspectStretch . x < float . Epsilon || aspectStretch . y < float . Epsilon )
@@ -329,7 +337,7 @@ public void GetQuadBounds(out Vector2 min, out Vector2 max)
329
337
Vector2 center = ( min + max ) / 2 ;
330
338
min -= center ;
331
339
max -= center ;
332
-
340
+
333
341
min . x *= aspectStretch . x ;
334
342
max . x *= aspectStretch . x ;
335
343
@@ -338,6 +346,9 @@ public void GetQuadBounds(out Vector2 min, out Vector2 max)
338
346
339
347
min += center ;
340
348
max += center ;
349
+
350
+ QuadMin = min ;
351
+ QuadMax = max ;
341
352
}
342
353
343
354
public void ForceRefresh ( )
0 commit comments