-void AbstractClipItem::setMaxDuration(const GenTime &max) {
- m_maxDuration = max;
-}
-
-QPainterPath AbstractClipItem::upperRectPart(QRectF br) {
- QPainterPath roundRectPathUpper;
- double roundingY = 20;
- double roundingX = 20;
- double offset = 1;
-
- while (roundingX > br.width() / 2) {
- roundingX = roundingX / 2;
- roundingY = roundingY / 2;
- }
- int br_endx = (int)(br.x() + br .width() - offset);
- int br_startx = (int)(br.x() + offset);
- int br_starty = (int)(br.y());
- int br_halfy = (int)(br.y() + br.height() / 2 - offset);
-
- roundRectPathUpper.moveTo(br_endx , br_halfy);
- roundRectPathUpper.arcTo(br_endx - roundingX , br_starty , roundingX, roundingY, 0.0, 90.0);
- roundRectPathUpper.lineTo(br_startx + roundingX , br_starty);
- roundRectPathUpper.arcTo(br_startx , br_starty , roundingX, roundingY, 90.0, 90.0);
- roundRectPathUpper.lineTo(br_startx , br_halfy);
-
- return roundRectPathUpper;
-}
-
-QPainterPath AbstractClipItem::lowerRectPart(QRectF br) {
- QPainterPath roundRectPathLower;
- double roundingY = 20;
- double roundingX = 20;
- double offset = 1;
-
- int br_endx = (int)(br.x() + br .width() - offset);
- int br_startx = (int)(br.x() + offset);
- int br_halfy = (int)(br.y() + br.height() / 2 - offset);
- int br_endy = (int)(br.y() + br.height() - 1);
-
- while (roundingX > br.width() / 2) {
- roundingX = roundingX / 2;
- roundingY = roundingY / 2;
- }
- roundRectPathLower.moveTo(br_startx, br_halfy);
- roundRectPathLower.arcTo(br_startx , br_endy - roundingY , roundingX, roundingY, 180.0, 90.0);
- roundRectPathLower.lineTo(br_endx - roundingX , br_endy);
- roundRectPathLower.arcTo(br_endx - roundingX , br_endy - roundingY, roundingX, roundingY, 270.0, 90.0);
- roundRectPathLower.lineTo(br_endx , br_halfy);
- return roundRectPathLower;