https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    07/12/2022, 5:02 PM
    im playing with an extern generator now
  • i

    icy-zebra-52882

    07/13/2022, 11:50 PM
    random suggestion: in haxeui-flixel, scrolling in a scrollable container should block the scroll event from bubbling up the chain to other scrollable parent containers, i.e. dropdown scrolling should block scrolling in parent scrollview
  • b

    bright-gpu-74537

    07/14/2022, 4:57 PM
    that should be the case, isnt it?
  • b

    bright-gpu-74537

    07/14/2022, 5:01 PM
    http://haxeui.org/builder/?rzdkqg
  • b

    best-agent-85158

    07/14/2022, 7:42 PM
    what am i doing wrong? this throws "Nothing to write"
  • b

    best-agent-85158

    07/14/2022, 7:43 PM
    Copy code
    haxe
    var save = new haxe.ui.containers.dialogs.SaveFileDialog();
    save.options = {
        title: "Save Page Number" + (editor.pages.getChildIndex(this) + 1),
        writeAsBinary: true
    };
    save.fileInfo = {
        name: fileName,
        isBinary: true,
        bytes: switch type {
            case PNG: bmp.encode(bmp.rect, new PNGEncoderOptions());
            case JPG: bmp.encode(bmp.rect, new JPEGEncoderOptions());
            default: throw new Exception("Unsupported file type");
        }
    };
            
    save.show();
  • b

    bright-gpu-74537

    07/14/2022, 7:47 PM
    Copy code
    haxe
            if (fileInfo == null || (fileInfo.text == null && fileInfo.bytes == null)) {
                throw "Nothing to write";
            }
  • b

    bright-gpu-74537

    07/14/2022, 7:47 PM
    are you sure bmp.encode(...) is leading to non-null bytes?
  • b

    best-agent-85158

    07/14/2022, 7:55 PM
    hmm ill check
  • b

    best-agent-85158

    07/14/2022, 7:59 PM
    theres no reason for it to return null tho
  • b

    best-agent-85158

    07/14/2022, 8:00 PM
    maybe
    BitmapData.encode()
    doesnt like html
  • b

    bright-gpu-74537

    07/14/2022, 8:00 PM
    does
    trace(bmp.encode(bmp.rect, new PNGEncoderOptions()) == null)
    trace true or false?
  • b

    best-agent-85158

    07/14/2022, 8:00 PM
    it returns null
  • b

    best-agent-85158

    07/14/2022, 8:00 PM
    but why is the question
  • b

    bright-gpu-74537

    07/14/2022, 8:00 PM
    right, so the exception is valid
  • b

    best-agent-85158

    07/14/2022, 8:00 PM
    yes
  • b

    best-agent-85158

    07/14/2022, 8:01 PM
    ill check hashlink and see if the error persists
  • b

    bright-gpu-74537

    07/14/2022, 8:01 PM
    i dunno about why its null... maybe rect is 0x0? Maybe bmp isnt valid?
  • b

    best-agent-85158

    07/14/2022, 8:01 PM
    bmp is just a copy of
    this
    bitmap, so it cant be null (its displayrd on the screen)
  • b

    best-agent-85158

    07/14/2022, 8:02 PM
    and bmp.rect is the image's dimensions
  • b

    bright-gpu-74537

    07/14/2022, 8:03 PM
    ... no idea then.. code seems sensible from a reading perspective
  • b

    best-agent-85158

    07/14/2022, 8:03 PM
    nope, still null
  • b

    best-agent-85158

    07/14/2022, 8:03 PM
    so wierd
  • b

    bright-gpu-74537

    07/14/2022, 8:04 PM
    see if you can repro it minimally, easy to work out if its a bug or a user issue that way (or a feature 🙂 )
  • b

    best-agent-85158

    07/14/2022, 8:14 PM
    solved, but its defo an OpenFL bug
  • b

    best-agent-85158

    07/14/2022, 8:15 PM
    Copy code
    haxe
    bmp.encode(bmp.rect, new PNGEncoderOptions(), byteArr);
    this returns the correct value, even tho a byteArray is optional there
  • b

    bright-gpu-74537

    07/14/2022, 8:19 PM
    https://github.com/openfl/openfl/blob/develop/src/openfl/display/BitmapData.hx#L1149
  • b

    bright-gpu-74537

    07/14/2022, 8:20 PM
    not even sure what that is trying to do
  • b

    bright-gpu-74537

    07/14/2022, 8:22 PM
    ok, i think i get it... its:
    Copy code
    byteArray = null;
    return null;
    when none of the other branches match
  • b

    bright-gpu-74537

    07/14/2022, 8:22 PM
    ugly way to construct that imo
1...116411651166...1687Latest