Skip to content

Commit

Permalink
Fixed bug with MultiScaleImage::source property.
Browse files Browse the repository at this point in the history
  • Loading branch information
gasi committed Sep 9, 2009
1 parent a704459 commit a3c2ff6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.txt
@@ -1,8 +1,12 @@
- Fixed bug in MultiScaleImage component for both Flash and Flex where setting
the source property with the same value twice caused the image to disappear.
-- Thanks to Claudius for reporting this.

Version 0.4.2.1 - September 4, 2009
===================================

- Fixed bug "#1004: Namespace was not found or is not a compile-time constant"
which occurred in Flash CS3.
which occurred in Flash CS3. -- Thanks to Nigel for reporting this.

- Fixed bug in MultiScaleImageBase::scale getter.

Expand Down
21 changes: 10 additions & 11 deletions src/org/openzoom/flash/components/MultiScaleImage.as
Expand Up @@ -140,13 +140,6 @@ public final class MultiScaleImage extends MultiScaleImageBase

public function set source(value:Object):void
{
if (_source)
{
_source = null
container.removeChildAt(0)
viewport.showAll(true)
}

if (value is String)
{
if (String(value) === url)
Expand All @@ -169,6 +162,14 @@ public final class MultiScaleImage extends MultiScaleImageBase
urlLoader_securityErrorHandler,
false, 0, true )
}

if (_source)
{
_source = null

if (container.numChildren > 0)
container.removeChildAt(0)
}

if (value is IImagePyramidDescriptor)
{
Expand Down Expand Up @@ -213,6 +214,7 @@ public final class MultiScaleImage extends MultiScaleImageBase
sceneHeight)

container.addChild(image)
container.showAll(true)
dispatchEvent(new Event(Event.COMPLETE))
}

Expand Down Expand Up @@ -249,10 +251,7 @@ public final class MultiScaleImage extends MultiScaleImageBase
ImagePyramidDescriptorFactory.getInstance()
var descriptor:IImagePyramidDescriptor = factory.getDescriptor(url, data)

_source = descriptor
addImage(descriptor)

viewport.showAll(true)
source = descriptor
}

/**
Expand Down
22 changes: 9 additions & 13 deletions src/org/openzoom/flex/components/MultiScaleImage.as
Expand Up @@ -141,14 +141,6 @@ public final class MultiScaleImage extends MultiScaleImageBase

public function set source(value:Object):void
{
if (_source)
{
_source = null

if (container.numChildren > 0)
container.removeChildAt(0)
}

if (value is String)
{
if (url == String(value))
Expand All @@ -167,6 +159,14 @@ public final class MultiScaleImage extends MultiScaleImageBase
urlLoader_securityErrorHandler,
false, 0, true)
}

if (_source)
{
_source = null

if (container.numChildren > 0)
container.removeChildAt(0)
}

if (value is IImagePyramidDescriptor)
{
Expand Down Expand Up @@ -215,7 +215,6 @@ public final class MultiScaleImage extends MultiScaleImageBase

container.addChild(image)
container.showAll(true)

dispatchEvent(new Event(Event.COMPLETE))
}

Expand All @@ -240,10 +239,7 @@ public final class MultiScaleImage extends MultiScaleImageBase
var descriptor:IImagePyramidDescriptor =
factory.getDescriptor(url, data)

_source = descriptor
dispatchEvent(new Event("sourceChanged"))

addImage(descriptor)
source = descriptor
}

/**
Expand Down

0 comments on commit a3c2ff6

Please sign in to comment.