Giter Site home page Giter Site logo

Comments (6)

Wiladams avatar Wiladams commented on May 25, 2024

Narrowing it down further, it definitely seems to be something right around the border, when the stroke rectangle is crossing over the limit of the bitmap. Windows 10 (64-bit OS), blend2d built as 32-bit.

local function main()
    local x = 390
    local y = 10
    local width = 100
    local height = 100

    -- setup context
    local img = BLImage()
    blapi.blImageInitAs(img, 400, 400, C.BL_FORMAT_PRGB32)
    local ctx = BLContext()
    blapi.blContextInitAs(ctx, img, nil)

    local recti = BLRectI({x,y,width,height})
    print("blContextClipToRectI: ", blapi.blContextClipToRectI(ctx, recti)) ;


    translate(ctx, x, y)

    --local srecti = BLRectI(0,0,width,height)
    local srecti = ffi.new("BLRectI")
    srecti.x = 0;
    srecti.y = 0;

    srecti.h = 10;
    -- will NOT crash
    --srecti.w = 13;
    -- WILL crash
    srecti.w = 14;

    blapi.blContextStrokeRectI(ctx, srecti)
end

from blend2d.

Wiladams avatar Wiladams commented on May 25, 2024

still working it. I can get it to NOT crash in another circumstance by rearranging code, so I'm back to thinking it might be a LuaJIT interaction.

from blend2d.

Wiladams avatar Wiladams commented on May 25, 2024

Rearranged code, got as raw as possible

    -- will NOT crash
    --srecti.w = 14;

    -- WILL crash
    srecti.w = 15;

Can still reliably reproduce a crash. I guess next thing is to use C instead of Lua to completely eliminate that as a possibility, and crack out the debugger to figure out where it's actually crashing.

from blend2d.

kobalicek avatar kobalicek commented on May 25, 2024

Should be fixed by b27e2b2 - Thanks for the report!

from blend2d.

Wiladams avatar Wiladams commented on May 25, 2024

fixes the crash, but introduces new challenges. Now, when I setup a clip, then draw beyond, all subsequent drawing after that will not occur, until a clearAll().

from blend2d.

Wiladams avatar Wiladams commented on May 25, 2024

as a proof point that this issue has been fixed, several examples of complex clipping that previous showed challenges

Clipping

from blend2d.

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.