Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_draw.c
| Show First 20 Lines • Show All 1,215 Lines • ▼ Show 20 Lines | if (ca->dtx & CAM_DTX_HARMONY_TRI_B) { | ||||
| drawviewborder_triangle(x1, x2, y1, y2, 1, 'B'); | drawviewborder_triangle(x1, x2, y1, y2, 1, 'B'); | ||||
| } | } | ||||
| if (ca->flag & CAM_SHOWTITLESAFE) { | if (ca->flag & CAM_SHOWTITLESAFE) { | ||||
| UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25, 0); | UI_ThemeColorBlendShade(TH_VIEW_OVERLAY, TH_BACK, 0.25, 0); | ||||
| hmargin = 0.1f * (x2 - x1); | hmargin = 0.1f * (x2 - x1); | ||||
| vmargin = 0.05f * (y2 - y1); | vmargin = 0.05f * (y2 - y1); | ||||
| uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1 + vmargin, x2 - hmargin, y2 - vmargin, 2.0f); | UI_draw_roundbox_gl_mode(GL_LINE_LOOP, x1 + hmargin, y1 + vmargin, x2 - hmargin, y2 - vmargin, 2.0f); | ||||
| hmargin = 0.035f * (x2 - x1); | hmargin = 0.035f * (x2 - x1); | ||||
| vmargin = 0.035f * (y2 - y1); | vmargin = 0.035f * (y2 - y1); | ||||
| uiDrawBox(GL_LINE_LOOP, x1 + hmargin, y1 + vmargin, x2 - hmargin, y2 - vmargin, 2.0f); | UI_draw_roundbox_gl_mode(GL_LINE_LOOP, x1 + hmargin, y1 + vmargin, x2 - hmargin, y2 - vmargin, 2.0f); | ||||
| } | } | ||||
| if (ca->flag & CAM_SHOWSENSOR) { | if (ca->flag & CAM_SHOWSENSOR) { | ||||
| /* determine sensor fit, and get sensor x/y, for auto fit we | /* determine sensor fit, and get sensor x/y, for auto fit we | ||||
| * assume and square sensor and only use sensor_x */ | * assume and square sensor and only use sensor_x */ | ||||
| float sizex = scene->r.xsch * scene->r.xasp; | float sizex = scene->r.xsch * scene->r.xasp; | ||||
| float sizey = scene->r.ysch * scene->r.yasp; | float sizey = scene->r.ysch * scene->r.yasp; | ||||
| int sensor_fit = BKE_camera_sensor_fit(ca->sensor_fit, sizex, sizey); | int sensor_fit = BKE_camera_sensor_fit(ca->sensor_fit, sizex, sizey); | ||||
| float sensor_x = ca->sensor_x; | float sensor_x = ca->sensor_x; | ||||
| Show All 18 Lines | if (ca->flag & CAM_SHOWSENSOR) { | ||||
| rect.xmin = (x1i + x2i) * 0.5f - sensor_width * 0.5f; | rect.xmin = (x1i + x2i) * 0.5f - sensor_width * 0.5f; | ||||
| rect.xmax = rect.xmin + sensor_width; | rect.xmax = rect.xmin + sensor_width; | ||||
| rect.ymin = y1i; | rect.ymin = y1i; | ||||
| rect.ymax = y2i; | rect.ymax = y2i; | ||||
| } | } | ||||
| /* draw */ | /* draw */ | ||||
| UI_ThemeColorShade(TH_VIEW_OVERLAY, 100); | UI_ThemeColorShade(TH_VIEW_OVERLAY, 100); | ||||
| uiDrawBox(GL_LINE_LOOP, rect.xmin, rect.ymin, rect.xmax, rect.ymax, 2.0f); | UI_draw_roundbox_gl_mode(GL_LINE_LOOP, rect.xmin, rect.ymin, rect.xmax, rect.ymax, 2.0f); | ||||
| } | } | ||||
| } | } | ||||
| setlinestyle(0); | setlinestyle(0); | ||||
| glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); | glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); | ||||
| /* camera name - draw in highlighted text color */ | /* camera name - draw in highlighted text color */ | ||||
| if (ca && (ca->flag & CAM_SHOWNAME)) { | if (ca && (ca->flag & CAM_SHOWNAME)) { | ||||
| ▲ Show 20 Lines • Show All 2,391 Lines • Show Last 20 Lines | |||||