git-svn-id: svn://db.shs.com.ru/libs@544 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -121,6 +121,7 @@ GLRendererBase * QGLView::renderer() {
|
||||
return renderer_;
|
||||
}
|
||||
|
||||
|
||||
void QGLView::setRenderer(GLRendererBase * r, GLRendererBase ** prev) {
|
||||
if (prev != nullptr) *prev = renderer_;
|
||||
renderer_ = r;
|
||||
@@ -235,9 +236,7 @@ void QGLView::selectObject(GLObjectBase * o) {
|
||||
|
||||
|
||||
void QGLView::resizeEvent(QResizeEvent * e) {
|
||||
// if (isExposed())
|
||||
// resizeGL(width(), height());
|
||||
/* QWindow::resizeEvent(e);*/
|
||||
renderLater();
|
||||
}
|
||||
|
||||
void QGLView::timerEvent(QTimerEvent *) {
|
||||
@@ -509,6 +508,8 @@ void QGLView::renderSingleSelection(GLObjectBase & o) {
|
||||
QMatrix4x4 curview = start_rp.view_matrix * start_rp.cam_offset_matrix * o.itransform_;
|
||||
uint id = qHash((quint64)&o);
|
||||
ids.insert(id, &o);
|
||||
glLineWidth(o.line_width > 0.f ? o.line_width : lineWidth_);
|
||||
glPointSize(o.line_width > 0.f ? o.line_width : lineWidth_);
|
||||
if (shaders_supported){
|
||||
if (shader_select) {
|
||||
if (shader_select->isLinked()) {
|
||||
@@ -620,11 +621,13 @@ void QGLView::applyFog() {
|
||||
void QGLView::resizeGL(int width, int height) {
|
||||
if (!is_init) return;
|
||||
if (width <= 0 || height <= 0) return;
|
||||
if (prev_size == QSize(width, height)) return;
|
||||
prev_size = QSize(width, height);
|
||||
aspect = float(width) / float(height);
|
||||
if (renderer_) renderer_->resize(width, height);
|
||||
mouse_first = true;
|
||||
//qDebug() << "resize" << width << height;
|
||||
fbo_selection.resize(width, height);
|
||||
mouse_first = true;
|
||||
iaspect = (aspect == 0.f) ? 0. : 1 / aspect;
|
||||
glViewport(0, 0, width, height);
|
||||
emit glResize(width, height);
|
||||
@@ -632,6 +635,7 @@ void QGLView::resizeGL(int width, int height) {
|
||||
|
||||
|
||||
void QGLView::mouseReleaseEvent(QMouseEvent * e) {
|
||||
// qDebug() << "mouseReleaseEvent" << e << isActive();
|
||||
// QGraphicsView::mouseReleaseEvent(e);
|
||||
//setCursor(QCursor(Qt::ArrowCursor));
|
||||
selecting_ = false;
|
||||
@@ -646,6 +650,7 @@ void QGLView::mouseReleaseEvent(QMouseEvent * e) {
|
||||
|
||||
|
||||
void QGLView::mousePressEvent(QMouseEvent * e) {
|
||||
// qDebug() << "mousePressEvent" << e << isActive();
|
||||
// QGraphicsView::mousePressEvent(e);
|
||||
// mouseThis_ = (scene()->itemAt(mapToScene(e->pos()) , QTransform() ) == 0);
|
||||
selecting_ = false;
|
||||
@@ -661,13 +666,13 @@ void QGLView::mousePressEvent(QMouseEvent * e) {
|
||||
|
||||
|
||||
void QGLView::mouseMoveEvent(QMouseEvent * e) {
|
||||
// qDebug() << e->pos();
|
||||
// qDebug() << "mouseMoveEvent" << e << isActive();
|
||||
// QGraphicsView::mouseMoveEvent(e);
|
||||
//lastPos = e->pos();
|
||||
if (selecting_) {
|
||||
|
||||
return;
|
||||
}
|
||||
// if (!QRect(QPoint(), size()).contains(e->pos())) return;
|
||||
//if (scene()->itemAt(mapToScene(e->pos())) != 0) return;
|
||||
///qDebug() << e->x() << e->y();
|
||||
QRect g_rect(QPoint(), size());
|
||||
|
||||
Reference in New Issue
Block a user