All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mapbox.mapboxsdk.views.safecanvas.SafePaint Maven / Gradle / Ivy

There is a newer version: 9.2.1
Show newest version
package com.mapbox.mapboxsdk.views.safecanvas;

import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.PathEffect;

/**
 * The SafePaint class is designed to work in conjunction with {@link SafeTranslatedCanvas} to work
 * around various Android issues with large canvases.
 *
 * @author Marc Kurtz
 * @see {@link ISafeCanvas}
 */
public class SafePaint extends Paint {

    @Override
    public PathEffect setPathEffect(PathEffect effect) {
        if (effect instanceof DashPathEffect) {
            throw new RuntimeException(
                    "Do not use DashPathEffect. Use SafeDashPathEffect instead.");
        }
        return super.setPathEffect(effect);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy