Giter Club home page Giter Club logo

Comments (7)

kottenator avatar kottenator commented on June 10, 2024

Hi!

Sorry, I have not implemented this option yet (it was not required till now).

However, you may do next:

$.circleProgress.defaults.drawArc = function(v) {
    var ctx = this.ctx,
        r = this.radius,
        t = this.getThickness(),
        a = this.startAngle;

    ctx.save();
    ctx.beginPath();

    if (!this.reverse) {
        ctx.arc(r, r, r - t / 2, a, a + Math.PI * 2 * v);
    } else {
        ctx.arc(r, r, r - t / 2, a - Math.PI * 2 * v, a);
    }

    ctx.lineWidth = t;
    ctx.lineCap = "round"; // this line do the trick that you need
    ctx.strokeStyle = this.arcFill;
    ctx.stroke();
    ctx.restore();
}

$.circleProgress.defaults.drawFrame = function(v) {
    this.lastFrameValue = v;
    this.ctx.clearRect(0, 0, this.size, this.size);
    this.drawEmptyArc(v); // we switch this line ...
    this.drawArc(v); // ... and this one
}

Looks like a hack but it works. Probably I'd implement this option in next version

from jquery-circle-progress.

kottenator avatar kottenator commented on June 10, 2024

I close this issue now. But no worries, I'm going to implement "nice way" to make corners rounded in the next version

from jquery-circle-progress.

crecotun avatar crecotun commented on June 10, 2024

Awesome man!

from jquery-circle-progress.

crecotun avatar crecotun commented on June 10, 2024

Я в настройках искал строку "lineCap"
Не найдя, полез в код, но не знал как поправить его нормально.

from jquery-circle-progress.

kottenator avatar kottenator commented on June 10, 2024

Да, я специально оставил лазейку в виде $.circleProgress.defaults для сложной кастомизации.

FYI, по сути $.circleProgress.defaults - это прототип конструктора, поэтому изменив что-то в defaults, ты изменяешь это во всех экземплярах на странице (но чтобы изменения вступили в силу, надо сделать el.circleProgress() еще раз)

from jquery-circle-progress.

crecotun avatar crecotun commented on June 10, 2024

Да, уже догадался :)

from jquery-circle-progress.

kottenator avatar kottenator commented on June 10, 2024

I've released v1.1.2 and there is new config option: lineCap: "round" Happy New Year! ;)

from jquery-circle-progress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.