haxeui / haxeui-core

The core library of the HaxeUI framework
http://haxeui.org
MIT License
346 stars 72 forks source link

background-image-clip causes $smake crash in buttons example #291

Closed XANOZOID closed 5 years ago

XANOZOID commented 5 years ago

The buttons example for openfl fails to build when trying to use background-image-clip in any of the button-icon styles. After commenting that specific one out it compiles, but looks weird.

Expected Behavior

We'd be able to use clipped images.

Current Behavior

Compile-time error:

Called from ? line 1
Called from ApplicationMain.hx line 25
Called from ApplicationMain.hx line 130
Called from lime/app/Application.hx line 150
Called from lime/_internal/backend/native/NativeApplication.hx line 146
Called from lime/_internal/backend/native/NativeApplication.hx line 370
Called from lime/_internal/macros/EventMacro.hx line 91
Called from openfl/display/Stage.hx line 1878
Called from openfl/display/Stage.hx line 1168
Called from openfl/display/Stage.hx line 1428
Called from C:\HaxeToolkit\haxe\std/neko/Lib.hx line 65
Called from openfl/display/Stage.hx line 1164
Called from openfl/display/DisplayObject.hx line 1430
Called from openfl/events/EventDispatcher.hx line 402
Called from haxe/ui/backend/TimerImpl.hx line 16
Called from haxe/ui/util/Timer.hx line 10
Called from haxe/ui/validation/ValidationManager.hx line 130
Called from haxe/ui/core/Component.hx line 1293
Called from haxe/ui/backend/ComponentImpl.hx line 65
Called from haxe/ui/backend/openfl/OpenFLStyleHelper.hx line 159
Called from haxe/ui/ToolkitAssets.hx line 86
Called from haxe/ui/backend/AssetsImpl.hx line 49
Called from haxe/ui/ToolkitAssets.hx line 88
Called from haxe/ui/ToolkitAssets.hx line 113
Called from haxe/ui/util/CallbackMap.hx line 66
Called from haxe/ui/backend/openfl/OpenFLStyleHelper.hx line 161
Called from haxe/ui/backend/openfl/OpenFLStyleHelper.hx line 198
Called from openfl/display/BitmapData.hx line 128
Called from openfl/display/BitmapData.hx line 278
Called from lime/utils/ArrayBufferView.hx line 7
Called from lime/utils/ArrayBufferView.hx line 37
Called from haxe/io/Bytes.hx line 508
Uncaught exception - $smake

Steps to Reproduce (for bugs)

  1. Clone the examples repo https://github.com/haxeui/component-examples
  2. cd buttons
  3. haxelib run lime test neko
  4. Error . . . Comment out all background-image-clip to see it work

Test app / minimal test case

<vbox style="padding: 5px;">    
    <style>
    .bitmapButton {
        background-image: "haxeui-core/styles/default/haxeui_tiny.png";
        background-image-clip: 0px 0px 40px 94px;
        background-image-slice: 10px 10px 30px 84px;
    }
    </style>

    <grid columns="2">
        <button text="Bitmap" styleName="bitmapButton" />
    </grid>
</vbox>

Context

I just wanted a custom-textured button.

Your Environment

ianharrigan commented 5 years ago

Should be fixed now, can you retest and let me know if that fixes it your end?

Cheers, Ian

XANOZOID commented 5 years ago

Looks like it works! Thanks Ian