Exemplo n.º 1
0
double ZCircle::getAdjustedRadius(double r) const
{
  double adjustedRadius = r;
  if (!m_usingCosmeticPen) {
    adjustedRadius += getPenWidth() * 0.5;
  }

  return adjustedRadius;
}
Exemplo n.º 2
0
void ZCircle::display(ZPainter &painter, int n,
                      ZStackObject::EDisplayStyle style) const
{
  if (!isVisible()) {
    return;
  }

  UNUSED_PARAMETER(style);
#if _QT_GUI_USED_
  painter.save();

  QPen pen(m_color, getPenWidth());
  pen.setCosmetic(m_usingCosmeticPen);

  if (hasVisualEffect(VE_DASH_PATTERN)) {
    pen.setStyle(Qt::DotLine);
  }

  painter.setPen(pen);

  //qDebug() << "Internal color: " << m_color;
//  const QBrush &oldBrush = painter.getBrush();
  if (hasVisualEffect(VE_GRADIENT_FILL)) {
    QRadialGradient gradient(50, 50, 50, 50, 50);
    gradient.setColorAt(0, QColor::fromRgbF(0, 1, 0, 1));
    gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));

    /*
    QBrush brush(gradient);
    brush.setColor(m_color);
    brush.setStyle(Qt::RadialGradientPattern);
    painter.setBrush(brush);
    */
    //painter.setBrush(m_color);
    //painter.setBrush(QBrush(m_color, Qt::RadialGradientPattern));
  } else {
    if (hasVisualEffect(VE_NO_FILL)) {
      painter.setBrush(Qt::NoBrush);
    }
  }
  displayHelper(&painter, n, style);
//  painter.setBrush(oldBrush);

  painter.restore();
#endif
}
Exemplo n.º 3
0
void SpellItem::childHovering(bool requests)
{
	// A child requests hovering focus
	if (requests == true)
	{
		if (isHovered_ == true)
		{
			// Drop hovering focus
			this->setPen(this->getDefaultPen());
			updatePathsColor(getDefaultPathPen().brush());
		}
	}
	else
	{
		// The child has released hovering focus. We need to grab it back
		if (isHovered_ == true)
		{
			// Reactivate hover
			this->setPen(QPen(QBrush(colorHover()), getPenWidth()));
			updatePathsColor(colorPathHover());
		}
	}
}
void BrushSettingsWindow::widthInputChanged()
{
    currentPen.setWidth(getPenWidth());
}
void BrushSettingsWindow::increaseButtonPressed()
{
    qint32 value = qBound(1, getPenWidth() + 1, maxBrushSize);
    widthEdit->setText(QString::number(value));
    currentPen.setWidth(value);
}